Skip to content

Commit

Permalink
update postpr
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang committed Aug 29, 2024
1 parent 991b538 commit 5768fdf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cleanup-cache-postpr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
REPO=${{ github.repository }}
gh run download ${{ github.event.workflow_run.id }} -n pr_number
pr_number=`cat pr_number.txt`
pr_number=$(jq --raw-output .workflow_run.pull_requests[0].number < ${GITHUB_EVENT_PATH})
echo "Clean up cache for PR ${pr_number}."
BRANCH=refs/pull/${pr_number}/merge
# Setting this to not fail the workflow while deleting cache keys.
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/post-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ on:
types:
- closed

# Because this workflow is run in the context of a pull_request event, it
# does not have the permission to remove caches. We use this workflow to
# trigger CleanUpCachePostPR to remove caches.

jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Save PR number
env:
PR_NUMBER: ${{ github.event.number }}
run: |
echo $PR_NUMBER > pr_number.txt
- uses: actions/upload-artifact@v4
with:
name: pr_number
path: pr_number.txt
retention-days: 1
- name: Do nothing
run: echo "This workflow will trigger CleanUpCachePostPR."

0 comments on commit 5768fdf

Please sign in to comment.