diff options
author | Christopher Haster <chaster@utexas.edu> | 2021-01-05 12:12:39 +0300 |
---|---|---|
committer | Christopher Haster <chaster@utexas.edu> | 2021-01-10 22:20:11 +0300 |
commit | c9110617b3833a3020e7f13025f2055c549e1b08 (patch) | |
tree | 2190e713b4d7f148fa67c515eb86f51f02a596b8 /.github/workflows/status.yml | |
parent | 104d65113d4a73e4f38cc976e70a3afeb743d52a (diff) |
Added post-release script, cleaned up workflows
This helps an outstanding maintainer annoyance: updating dependencies to
bring in new versions on each littlefs release.
But instead of adding a bunch of scripts to the tail end of the release
workflow, the post-release script just triggers a single
"repository_dispatch" event in the newly created littlefs.post-release
repo. From there any number of post-release workflows can be run.
This indirection should let the post-release scripts move much quicker
than littlefs itself, which helps offset how fragile these sort of scripts
are.
---
Also finished cleaning up the workflows now that they are mostly
working.
Diffstat (limited to '.github/workflows/status.yml')
-rw-r--r-- | .github/workflows/status.yml | 61 |
1 files changed, 10 insertions, 51 deletions
diff --git a/.github/workflows/status.yml b/.github/workflows/status.yml index 55165ad..7bd851a 100644 --- a/.github/workflows/status.yml +++ b/.github/workflows/status.yml @@ -6,30 +6,21 @@ on: jobs: status: - runs-on: ubuntu-latest - continue-on-error: true - + runs-on: ubuntu-18.04 steps: - - run: echo "${{toJSON(github.event.workflow_run)}}" - # custom statuses? - uses: dawidd6/action-download-artifact@v2 + continue-on-error: true with: workflow: ${{github.event.workflow_run.name}} run_id: ${{github.event.workflow_run.id}} name: status path: status - name: update-status + continue-on-error: true run: | - # TODO remove this ls status - for f in status/*.json - do - cat $f - done - - shopt -s nullglob - for s in status/*.json + for s in $(shopt -s nullglob ; echo status/*.json) do # parse requested status export STATE="$(jq -er '.state' $s)" @@ -43,7 +34,7 @@ jobs: export TARGET_STEP="$(jq -er '.target_step // ""' $s)" curl -sS -H "authorization: token ${{secrets.BOT_TOKEN}}" \ "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/runs/` - `${{github.event.workflow_run.id}}/jobs" \ + `${{github.event.workflow_run.id}}/jobs" \ | jq -er '.jobs[] | select(.name == env.TARGET_JOB) | .html_url @@ -51,46 +42,14 @@ jobs: + ((.steps[] | select(.name == env.TARGET_STEP) | "#step:\(.number):0") // "")'))" - # TODO remove this - # print for debugging - echo "$(jq -nc '{ - state: env.STATE, - context: env.CONTEXT, - description: env.DESCRIPTION, - target_url: env.TARGET_URL}')" # update status - curl -sS -H "authorization: token ${{secrets.BOT_TOKEN}}" \ - -X POST "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/statuses/` + curl -sS -X POST -H "authorization: token ${{secrets.BOT_TOKEN}}" \ + "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/statuses/` `${{github.event.workflow_run.head_sha}}" \ - -d "$(jq -nc '{ + -d "$(jq -n '{ state: env.STATE, context: env.CONTEXT, description: env.DESCRIPTION, - target_url: env.TARGET_URL}')" - - #if jq -er '.target_url' $s - #then - # export TARGET_URL="$(jq -er '.target_url' $s)" - #elif jq -er '.target_job' $s - #then - # - #fi - + target_url: env.TARGET_URL}' \ + | tee /dev/stderr)" done - - - - -# - id: status -# run: | -# echo "::set-output name=description::$(cat statuses/x86_64.txt | tr '\n' ' ')" -# - uses: octokit/request-action@v2.x -# with: -# route: POST /repos/{repo}/status/{sha} -# repo: ${{github.repository}} -# sha: ${{github.event.status.sha}} -# context: ${{github.event.status.context}} -# state: ${{github.event.status.state}} -# description: ${{steps.status.outputs.description}} -# target_url: ${{github.event.status.target_url}} -# |