mirror of
https://github.com/joaquinjsb/gitea-release-please-action
synced 2026-05-13 22:51:36 +02:00
build: switch to code-suggester action (#990)
build: use YOSHI_CODE_BOT_TOKEN
This commit is contained in:
50
.github/workflows/release-please.yaml
vendored
50
.github/workflows/release-please.yaml
vendored
@@ -18,47 +18,21 @@ jobs:
|
|||||||
run: npm ci
|
run: npm ci
|
||||||
- name: build
|
- name: build
|
||||||
run: npm run build
|
run: npm run build
|
||||||
- name: commit
|
|
||||||
run: |-
|
|
||||||
set -e
|
|
||||||
# get current commit hash
|
|
||||||
CURRENT_HASH=$(git rev-parse HEAD)
|
|
||||||
# get last commit hash of last build dist
|
|
||||||
LAST_BUILD_HASH=$(git log --author=google-github-actions-bot -1 --pretty=format:"%H")
|
|
||||||
DIFF=""
|
|
||||||
# build and commit dist if diff
|
|
||||||
git config --global user.name "actions-bot"
|
|
||||||
git config user.email 'github-actions-bot@google.com'
|
|
||||||
git add dist/
|
|
||||||
git diff-index --quiet HEAD || git commit -m "chore: build dist ${ACTION_NAME}"
|
|
||||||
# if last commit hash of last build dist was found, get logs of commits in btw for PR body
|
|
||||||
if [ -z "$LAST_BUILD_HASH" ]
|
|
||||||
then
|
|
||||||
echo "Unable to find last commit by bot, skipping diff gen"
|
|
||||||
else
|
|
||||||
DIFF=$(git log ${LAST_BUILD_HASH}...${CURRENT_HASH} --oneline)
|
|
||||||
echo $DIFF
|
|
||||||
fi
|
|
||||||
# set env vars
|
|
||||||
echo "CURRENT_HASH=${CURRENT_HASH}" >> $GITHUB_ENV
|
|
||||||
echo "LAST_BUILD_HASH=${LAST_BUILD_HASH}" >> $GITHUB_ENV
|
|
||||||
echo 'DIFF<<EOF' >> $GITHUB_ENV
|
|
||||||
echo "${DIFF}" >> $GITHUB_ENV
|
|
||||||
echo 'EOF' >> $GITHUB_ENV
|
|
||||||
- name: Create PR with dist
|
- name: Create PR with dist
|
||||||
uses: peter-evans/create-pull-request@v5
|
uses: googleapis/code-suggester@v4
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
upstream_repo: release-please-action
|
||||||
commit-message: Build dist
|
upstream_owner: googleapis
|
||||||
author: "actions-bot <github-actions-bot@google.com>"
|
description: Build dist
|
||||||
title: "chore: build dist"
|
title: "chore: build dist"
|
||||||
body: |
|
message: "chore: build dist"
|
||||||
Build dist PR
|
|
||||||
${{env.DIFF}}
|
|
||||||
labels: automated pr
|
labels: automated pr
|
||||||
branch: create-pull-request/build-dist
|
branch: build-dist
|
||||||
delete-branch: true
|
force: true
|
||||||
push-to-fork: google-github-actions-bot/${{env.ACTION_NAME}}
|
git_dir: .
|
||||||
|
fork: true
|
||||||
|
env:
|
||||||
|
ACCESS_TOKEN: ${{ secrets.YOSHI_CODE_BOT_TOKEN }}
|
||||||
release-please-release:
|
release-please-release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [build]
|
needs: [build]
|
||||||
@@ -93,7 +67,7 @@ jobs:
|
|||||||
- id: release-pr
|
- id: release-pr
|
||||||
uses: googleapis/release-please-action@main
|
uses: googleapis/release-please-action@main
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
token: ${{ secrets.YOSHI_CODE_BOT_TOKEN }}
|
||||||
release-type: node
|
release-type: node
|
||||||
fork: true
|
fork: true
|
||||||
skip-github-release: true
|
skip-github-release: true
|
||||||
|
|||||||
Reference in New Issue
Block a user