TEST PR #13
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update table reference | |
on: | |
pull_request: | |
issue_comment: | |
types: [created] | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
SET_LOCA_REPO_PATH: ${{github.workspace}}/set | |
jobs: | |
doCommand: | |
runs-on: ubuntu-latest | |
if: github.event_name != 'issue_comment' || (github.event_name == 'issue_comment' && contains(github.event.comment.body, '/update-table-reference')) | |
container: ghcr.io/truongquangsb/update-table-reference:latest | |
permissions: | |
contents: write | |
checks: write | |
pull-requests: write | |
actions: read | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: swtbot/test | |
- name: Apply changes | |
shell: bash | |
run: | | |
ls | |
python -u -m updatereference --prNumber=861 | |
- name: Push | |
shell: bash | |
run: | | |
git status | |
git add -A | |
git commit -m "Update table reference" | |
git push | |
- name: Add comment reaction | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const payload = await github.rest.repos.getCollaboratorPermissionLevel({ | |
...context.repo, username: context.actor | |
}); | |
const userPermission = payload?.data?.permission; | |
let reaction = 'rocket' | |
if (!(userPermission == 'write' || userPermission == 'admin')) { // not a committer | |
// Not a committer -> abort workflow | |
core.setFailed("Only committers are permitted to request license vetting and " + context.actor + " isn't one.") | |
reaction = '-1' | |
} | |
// react on comment to give early feedback that the request was understood | |
await github.rest.reactions.createForIssueComment({ | |
...context.repo, comment_id: context.payload?.comment?.id, content: reaction | |
}); | |