Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
nadin-Starkware committed Oct 21, 2024
1 parent 494ebb4 commit fb9f474
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/updload_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,35 @@ jobs:
echo "The workflow run name is: ${{ github.run_id }}"
- name: Get PR Number
- name: Get PR Number 1
# if: github.event.workflow_run.pull_requests != ''
run: |
echo " pr num: ${{ github.event.workflow_run.event.number }}"
pr_number=$(echo "${{ toJson(github.event.workflow_run.pull_requests) }}" | jq '.[0].number')
echo "PR_NUMBER=$pr_number" >> $GITHUB_ENV
echo "The workflow run URL is: $GITHUB_RUN_URL"
- name: Checkout repository
uses: actions/checkout@v3

- name: Get Pull Request Number - 2
id: get_pr
run: |
pr=$(gh pr list --head ${{ github.event.workflow_run.head_branch }} --state open --json number --jq '.[0].number')
echo "PR_NUMBER=$pr" >> $GITHUB_ENV
echo "pr num is: $pr"
- name: Add a comment to the PR
if: env.PR_NUMBER != ''
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.createComment({
issue_number: process.env.PR_NUMBER,
owner: context.repo.owner,
repo: context.repo.repo,
body: "This is a comment added by the workflow."
})
- name: Authenticate with GCS
uses: "google-github-actions/auth@v2"
Expand Down

0 comments on commit fb9f474

Please sign in to comment.