ping #26339
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
name: build | |
on: | |
repository_dispatch: | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 19 | |
- name: Log incoming event information | |
id: incoming | |
run: | | |
echo "Event '${{ github.event.action }}' received from '${{ github.event.client_payload.repository }}'" | |
echo "https://github.com/${{ github.event.client_payload.repository }}/commit/${{ github.event.client_payload.sha }}" | |
echo "sha_short=$(echo ${{ github.event.client_payload.sha }} | cut -c1-7)}" >> $GITHUB_OUTPUT | |
echo "self_link=$(echo $(curl https://api.github.com/repos/w3c/mdn-spec-links/check-suites/$(curl https://api.github.com/repos/w3c/mdn-spec-links/actions/runs/${{ github.run_id }} | jq -r .check_suite_id)/check-runs | jq -r .check_runs[0].html_url)?check_suite_focus=true)}" >>$GITHUB_OUTPUT | |
- name: Run w3c/mdn-spec-links build | |
id: build | |
if: github.event.action == 'ping' || github.event_name == 'workflow_dispatch' | |
run: | | |
echo "conclusion=success" >> $GITHUB_OUTPUT | |
make report-BCD || echo "conclusion=failure" >> $GITHUB_OUTPUT | |
make report || echo "conclusion=failure" >> GITHUB_OUTPUT | |
- uses: crazy-max/ghaction-import-gpg@v5 | |
with: | |
gpg_private_key: ${{ secrets.GPG_SIGNING_KEY }} | |
passphrase: ${{ secrets.GPG_SIGNING_KEY_PASSPHRASE }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
- name: Create pull request | |
id: cpr | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
title: Incorporate new ${{ github.event.client_payload.repository }} changes | |
commit-message: | | |
Incorporate new ${{ github.event.client_payload.repository }} changes | |
Incorporate changes from https://github.com/${{ github.event.client_payload.repository }}/commit/${{ steps.incoming.outputs.sha_short }} | |
committer: sideshowbarkerbot <sideshowbarker+sideshowbarkerbot@gmail.com> | |
author: sideshowbarkerbot <sideshowbarker+sideshowbarkerbot@gmail.com> | |
assignees: sideshowbarker | |
reviewers: sideshowbarker | |
delete-branch: true | |
- name: Log pull request URL | |
if: ${{ steps.build.outputs.conclusion == 'success' }} | |
run: | | |
echo "Pull request URL: ${{ steps.cpr.outputs.pull-request-url }}" | |
- name: Set status | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
curl \ | |
-X POST \ | |
-H "Authorization: Bearer $GITHUB_TOKEN" \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
https://api.github.com/repos/w3c/mdn-spec-links/statuses/${{ github.sha }} \ | |
-d '{"state": "${{ steps.build.outputs.conclusion }}", "target_url": "${{ steps.incoming.outputs.self_link }}", "context": "Build triggered by ${{ github.event.client_payload.repository }} changes" }' | |
make report-only || true | |
if [[ "${{ steps.build.outputs.conclusion }}" == "failure" ]]; then exit 1; fi |