Dummy PR #8
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: Token issue debugging | |
on: | |
pull_request: | |
branches: [ main ] | |
env: | |
TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
debugging: | |
runs-on: ubuntu-latest | |
permissions: write-all | |
steps: | |
- name: Write with GH API | |
run: | | |
curl -LsX POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -d '{"body":"Hello :)"}' "${{ github.event.pull_request.comments_url }}" | |
echo $? | |
# - name: Try with github-script action | |
# uses: actions/github-script@v7 | |
# with: | |
# script: | | |
# github.rest.issues.createComment({ | |
# issue_number: context.issue.number, | |
# owner: context.repo.owner, | |
# repo: context.repo.repo, | |
# body: '👋 Thanks for reporting!' | |
# }) | |
- name: Try to delete a PR label | |
run: | | |
curl -sL -w "%{http_code}" -o output.txt -X DELETE -H "Authorization: Bearer $TOKEN" "${{ github.event.pull_request.issue_url }}/labels/invalid" | |
- name: Create a dummy file | |
run: | | |
mkdir dummy | |
- name: Upload data | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dummy | |
path: dummy/ | |
- name: Try to download an artifact | |
run: | | |
all_artifacts=$(curl -sSL ${{ github.event.pull_request.base.repo.url }}/actions/artifacts) | |
id=$(echo "$all_artifacts" | jq "first(.artifacts[] | .id)") | |
curl -sSLO -H "Authorization: Bearer $TOKEN" "${{ github.event.pull_request.base.repo.url }}/actions/artifacts/$id/zip" -D headers.txt | |
- name: Unzip downloaded artifact | |
run: | | |
unzip zip || (echo "Download of diff artifact failed" && cat headers.txt && cat zip && exit 1) |