Skip to content

Commit 0b71368

Browse files
committed
chore: update token for github test 6
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
1 parent e0644f7 commit 0b71368

1 file changed

Lines changed: 17 additions & 23 deletions

File tree

.github/workflows/sync-issue-labels-compute.yml

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -185,32 +185,26 @@ jobs:
185185
path: labels.json
186186
retention-days: 1
187187

188-
dispatch-add:
188+
dispatch-add:
189189
needs: compute-labels
190190
runs-on: ubuntu-latest
191191
steps:
192-
- name: Check Token Presence
193-
run: |
194-
if [ -z "$TOKEN" ]; then
195-
echo "::error::GH_ACCESS_TOKEN is missing! If this is a Fork PR, secrets are disabled by GitHub."
196-
exit 1
197-
else
198-
echo "Token is present."
199-
fi
200-
env:
201-
TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
202192
- name: Trigger add workflow
203-
uses: step-security/workflow-dispatch@acca1a315af3bf7f33dd116d3cb405cb83f5cbdc # v1.2.8
193+
uses: actions/github-script@v7
204194
with:
205-
workflow: .github/workflows/sync-issue-labels-add.yml
206-
repo: ${{ github.repository }}
207-
ref: main
208-
token: ${{ secrets.GH_ACCESS_TOKEN }}
209-
inputs: >-
210-
{
211-
"upstream_run_id":"${{ github.run_id }}",
212-
"pr_number":"${{ needs.compute-labels.outputs.pr_number }}",
213-
"dry_run":"${{ needs.compute-labels.outputs.dry_run }}",
214-
"is_fork_pr":"${{ needs.compute-labels.outputs.is_fork_pr }}"
215-
}
195+
# This uses your PAT that we verified is working!
196+
github-token: ${{ secrets.GH_ACCESS_TOKEN }}
197+
script: |
198+
await github.rest.actions.createWorkflowDispatch({
199+
owner: context.repo.owner,
200+
repo: context.repo.repo,
201+
workflow_id: 'sync-issue-labels-add.yml',
202+
ref: 'main',
203+
inputs: {
204+
upstream_run_id: "${{ github.run_id }}",
205+
pr_number: "${{ needs.compute-labels.outputs.pr_number }}",
206+
dry_run: "${{ needs.compute-labels.outputs.dry_run }}",
207+
is_fork_pr: "${{ needs.compute-labels.outputs.is_fork_pr }}"
208+
}
209+
});
216210

0 commit comments

Comments
 (0)