Skip to content

Commit 921384a

Browse files
fix(publish): address PR review feedback
- Use GH_BOT_TOKEN throughout workflow instead of GITHUB_TOKEN - Move PR comment to beginning of workflow before any changes - Update comment message to reflect it runs at start Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
1 parent b774d40 commit 921384a

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

.github/workflows/publish.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,23 @@ jobs:
1818
packages: write
1919
pull-requests: write
2020
steps:
21+
- name: Comment on PR
22+
uses: actions/github-script@v8
23+
with:
24+
github-token: ${{ secrets.GH_BOT_TOKEN }}
25+
script: |
26+
await github.rest.issues.createComment({
27+
owner: context.repo.owner,
28+
repo: context.repo.repo,
29+
issue_number: context.payload.pull_request.number,
30+
body: '⚠️ **Important**: This PR is being processed to add bottles. Please do not push any changes to this PR branch as it may cause conflicts or issues with the bottle publishing process. If you need to make changes, please close this PR and open a new one.'
31+
});
32+
2133
- name: Set up Homebrew
2234
uses: Homebrew/actions/setup-homebrew@main
2335
with:
2436
stable: true
25-
token: ${{ secrets.GITHUB_TOKEN }}
37+
token: ${{ secrets.GH_BOT_TOKEN }}
2638

2739
- name: Set up git
2840
run: |
@@ -49,8 +61,8 @@ jobs:
4961
5062
- name: Pull bottles
5163
env:
52-
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53-
HOMEBREW_GITHUB_PACKAGES_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
65+
HOMEBREW_GITHUB_PACKAGES_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
5466
HOMEBREW_GITHUB_PACKAGES_USER: ${{ github.repository_owner }}
5567
PULL_REQUEST: ${{ github.event.pull_request.number }}
5668
run: brew pr-pull --debug --workflows --tap="${GITHUB_REPOSITORY}" "${PULL_REQUEST}"
@@ -81,15 +93,3 @@ jobs:
8193
# For origin PRs, push to origin
8294
git push origin "HEAD:${PR_HEAD_REF}"
8395
fi
84-
85-
- name: Comment on PR
86-
uses: actions/github-script@v8
87-
with:
88-
github-token: ${{ secrets.GITHUB_TOKEN }}
89-
script: |
90-
await github.rest.issues.createComment({
91-
owner: context.repo.owner,
92-
repo: context.repo.repo,
93-
issue_number: context.payload.pull_request.number,
94-
body: '⚠️ **Important**: Bottles have been added to this PR. Please do not push any changes to this PR branch as it may cause conflicts or issues with the bottle publishing process. If you need to make changes, please close this PR and open a new one.'
95-
});

0 commit comments

Comments
 (0)