diff --git a/.github/workflows/releases-json.yml b/.github/workflows/releases-json.yml new file mode 100644 index 000000000000..b465d7068d02 --- /dev/null +++ b/.github/workflows/releases-json.yml @@ -0,0 +1,56 @@ +name: releases-json + +on: + release: + types: + - released + +env: + RELEASES_JSON_PATH: .github/releases.json + +jobs: + generate: + uses: crazy-max/.github/.github/workflows/releases-json.yml@5d21ab1b5b9e9bebca815e4d92b8310b4f8765ae + with: + repository: docker/buildx + secrets: inherit + + releases-json: + runs-on: ubuntu-22.04 + needs: + - generate + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Create .github/releases.json file + uses: actions/github-script@v6 + with: + script: | + const fs = require('fs'); + await fs.writeFileSync('${{ env.RELEASES_JSON_PATH }}', `${{ needs.generate.outputs.releases }}`); + - + name: Upload releases.json + uses: actions/upload-artifact@v3 + with: + name: releases-json + path: .github/releases.json + if-no-files-found: error + - + name: Commit changes + run: | + git add -A . + - + name: Create PR + uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 + with: + base: master + branch: releases-json/${{ github.event.release.name }} + commit-message: "update .github/releases.json" + signoff: true + delete-branch: true + title: "Update `.github/releases.json`" + body: | + Update `.github/releases.json` to keep in sync with GitHub Releases. + draft: false