Skip to content

Commit

Permalink
feat: post artifacts upload run link as a comment (#1519)
Browse files Browse the repository at this point in the history
  • Loading branch information
nadin-Starkware authored Oct 22, 2024
1 parent 8ebeac1 commit 8298fd3
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/upload_artifacts_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,29 @@ jobs:
with:
ref: ${{ env.COMMIT_SHA }}

- uses: actions/checkout@v4
# Set environment variables.
- name: Set environment variable
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pr_number=$(gh pr list --head "${{ github.event.workflow_run.head_branch }}" --json number --jq '.[0].number')
echo "PR_NUMBER=$pr_number" >> $GITHUB_ENV
echo "WORKFLOW_LINK=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV
- name: Add a comment to the PR
if: env.PR_NUMBER != ''
uses: actions/github-script@v6
with:
ref: ${{ env.COMMIT_SHA }}
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const workflowLink = process.env.WORKFLOW_LINK;
github.rest.issues.createComment({
issue_number: process.env.PR_NUMBER,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Artifacts upload triggered. [View details here](${workflowLink})`
})
- uses: ./.github/actions/bootstrap
- name: Build native blockifier
run: ./build_native_in_docker.sh scripts/build_native_blockifier.sh
Expand Down

0 comments on commit 8298fd3

Please sign in to comment.