Delete Artifact URL in PR #3219
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
# pr-comment-artifact-url.yml | |
--- | |
name: Delete Artifact URL in PR | |
on: | |
workflow_run: | |
types: | |
- "requested" | |
workflows: | |
- "Unity Cloud Build" | |
branches-ignore: | |
- "main" | |
permissions: | |
contents: read | |
pull-requests: write | |
jobs: | |
delete-comment: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get PR info | |
env: | |
WORKFLOW_RUN_EVENT_OBJ: ${{ toJSON(github.event.workflow_run) }} | |
OWNER: ${{ github.repository_owner }} | |
REPO: ${{ github.event.repository.name }} | |
run: | | |
PR_NUMBER=$(jq -r '.pull_requests[0].number' \ | |
<<< "$WORKFLOW_RUN_EVENT_OBJ") | |
echo "Pull request Number: $PR_NUMBER" | |
echo "PR_NUMBER=$PR_NUMBER" >> "$GITHUB_ENV" | |
- name: Find Comment | |
uses: peter-evans/find-comment@v2 | |
id: find-comment | |
with: | |
issue-number: ${{ env.PR_NUMBER }} | |
comment-author: 'github-actions[bot]' | |
- name: Update Comment | |
uses: peter-evans/create-or-update-comment@v3 | |
with: | |
issue-number: ${{ env.PR_NUMBER }} | |
comment-id: ${{ steps.find-comment.outputs.comment-id }} | |
edit-mode: replace | |
body: |- | |
![badge] <img src="https://ui.decentraland.org/decentraland_256x256.png" width="30"> | |
New build in progress, come back later! | |
[badge]: https://img.shields.io/badge/Build-Pending!-ffff00?logo=github&style=for-the-badge |