Skip to content

Commit

Permalink
Remove workflow cleanup (open-telemetry#2918)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyc-splunk authored Apr 3, 2023
1 parent 44d9be7 commit 80efe80
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/cleanup-closed-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,6 @@ jobs:
- name: Check out code
uses: actions/checkout@v3

- name: Workflow Cleanup
if: ${{ github.event.pull_request.merged == false }}
run: |
REPO=${{ github.repository }}
BRANCH="${{ github.head_ref }}"
echo "Fetching list of workflow runs for the $BRANCH branch"
runIdsForBranch=$(gh run list -R $REPO -b $BRANCH --json databaseId -q '.[].databaseId')
## Setting this to not fail the workflow while cancelling workflow runs.
set +e
for id in $runIdsForBranch
do
if [[ "${{ github.run_id }}" != "$id" ]]; then
echo "Cancelling workflow run ${{ github.server_url }}/${REPO}/actions/runs/${id} ..."
gh run cancel -R $REPO $id
fi
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Cache Cleanup
run: |
gh extension install actions/gh-actions-cache
Expand Down

0 comments on commit 80efe80

Please sign in to comment.