Skip to content

Commit 452d967

Browse files
committed
build(deps): update bump-gitstream-core workflow to handle reviewer input and output PR URL
1 parent fac0cec commit 452d967

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

.github/workflows/bump-gitstream-core.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131
runs-on: ubuntu-latest
3232
steps:
3333
- uses: actions/checkout@v6
34+
with:
35+
token: ${{ secrets.CI_USER_GIT_TOKEN }}
3436

3537
- name: Set version to ENV
3638
run: |
@@ -45,9 +47,9 @@ jobs:
4547
echo "LABEL_ARG=--label auto-deploy" >> "$GITHUB_ENV"
4648
4749
- name: Set reviewer
48-
if: inputs.reviewer
4950
run: |
50-
echo "REVIEWER_ARG=--reviewer ${{ inputs.reviewer }}" >> "$GITHUB_ENV"
51+
REVIEWER="${{ inputs.reviewer || github.actor }}"
52+
echo "REVIEWER_ARG=--reviewer $REVIEWER" >> "$GITHUB_ENV"
5153
5254
- name: Init npmrc
5355
run: |
@@ -60,17 +62,26 @@ jobs:
6062
run: npm run all
6163

6264
- name: Create PR for ${{ env.VERSION }}
65+
id: create-pr
6366
env:
64-
GH_TOKEN: ${{ github.token }}
67+
GH_TOKEN: ${{ secrets.CI_USER_GIT_TOKEN }}
6568
run: |
6669
echo -e "${{ inputs.description }}" > pr_description.txt
6770
git config --global user.name 'GitHub Actions Bot'
6871
git config --global user.email 'actions@github.com'
6972
git add package.json package-lock.json dist/index.js
7073
git commit -m "bump @linearb/gitstream-core to ${{ env.VERSION }}"
7174
git push origin HEAD:${{ env.BRANCH_NAME }}
72-
gh pr create \
75+
PR_URL=$(gh pr create \
7376
--base develop \
74-
--title "Bump \`@linearb/gitstream-core\` to \`${{ env.VERSION }}\`" \
77+
--title 'Bump `@linearb/gitstream-core` to `${{ env.VERSION }}`' \
7578
--body-file pr_description.txt \
76-
--head ${{ env.BRANCH_NAME }} ${{ env.REVIEWER_ARG }} ${{ env.LABEL_ARG }}
79+
--head ${{ env.BRANCH_NAME }} ${{ env.REVIEWER_ARG }} ${{ env.LABEL_ARG }})
80+
echo "pr_url=$PR_URL" >> $GITHUB_OUTPUT
81+
82+
- name: Output PR URL
83+
if: success()
84+
run: |
85+
echo "✅ PR created successfully: ${{ steps.create-pr.outputs.pr_url }}"
86+
echo "**✅ PR Created**" >> $GITHUB_STEP_SUMMARY
87+
echo "${{ steps.create-pr.outputs.pr_url }}" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)