volatilemolotov commented on code in PR #27210:
URL: https://github.com/apache/beam/pull/27210#discussion_r1237369986
##########
.github/actions/rerun-job-action/action.yml:
##########
@@ -0,0 +1,118 @@
+name: "Rerun Job Action"
+description: Re-runs a job that is attached to the PR as Check Run
+inputs:
+ pull_request_url:
+ description: "The URL of the PR"
+ required: true
+ github_repository:
+ description: "The GitHub repository"
+ required: true
+ github_token:
+ description: "The GitHub token"
+ required: true
+ github_job:
+ description: "The GitHub job"
+ required: true
+ github_current_run_id:
+ description: "The GitHub current run id. Not the same that is fetched in
this action"
+ required: true
+
+
+runs:
+ using: composite
+ steps:
+ - name: Get Last Commit SHA
+ shell: bash
+ run: |
+ URL=${{inputs.pull_request_url}}/commits
+ PRSHA=$(curl \
+ -H 'Authorization: Bearer ${{inputs.github_token}}' \
+ -H "Accept: application/vnd.github+json" \
+ -H "X-GitHub-Api-Version: 2022-11-28" \
+ -s $URL | jq -r '.[-1].sha' )
+ echo prsha=$PRSHA >> $GITHUB_ENV
+
+ - name: Get Status for PR Job
+ id: get_status
+ shell: bash
+ run: |
+
URL="${{github.api_url}}/repos/${{inputs.github_repository}}/commits/${{env.prsha}}/check-runs"
+ STATUS=$(curl \
+ -H 'Authorization: Bearer ${{inputs.github_token}}' \
+ -H "Accept: application/vnd.github+json" \
+ -H "X-GitHub-Api-Version: 2022-11-28" \
+ -s $URL | jq -r '.check_runs | .[] |
select(.name=="${{inputs.github_job}}") | .status')
+ echo status=$STATUS >> $GITHUB_ENV
+
+ - name: Get Conclusion for PR Job
Review Comment:
Leftover from PoC, will consolidate it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]