Mirror #37703
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: Mirror | |
on: | |
schedule: | |
- cron: '0 * * * *' | |
jobs: | |
fetch: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
repo: [library/golang, library/jruby, library/node, library/php, library/python, library/ruby] | |
steps: | |
- name: Fetch tags | |
uses: JamesIves/fetch-api-data-action@396ebea7d13904824f85b892b1616985f847301c # pin@v2 | |
with: | |
token-endpoint: https://auth.docker.io/token?service=registry.docker.io&scope=repository:${{ matrix.repo }}:pull | |
endpoint: https://registry-1.docker.io/v2/${{ matrix.repo }}/tags/list | |
configuration: '{"method": "GET", "headers": {"Authorization": "Bearer {{{ access_token }}}"}}' | |
save-location: /tmp | |
set-output: false | |
retry: true | |
- name: Write page | |
run: | | |
output=$(jq -r '"---", "permalink: /v2/${{ matrix.repo }}/tags/list", "---", .' /tmp/data.json) | |
test -z "$output" || echo "$output" | install -D /dev/stdin ${{ matrix.repo }}.html | |
- name: Upload page | |
uses: actions/upload-artifact@3446296876d12d4e3a0f3145a3c87e67bf0a16b5 # pin@v1 | |
with: | |
name: mirror | |
path: . | |
push: | |
needs: fetch | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3 | |
- uses: actions/download-artifact@18f0f591fbc635562c815484d73b6e8e3980482e # pin@v1 | |
with: | |
name: mirror | |
path: . | |
- run: test -z "$(git status --porcelain)" || echo "PUSH=true" >> $GITHUB_ENV | |
- if: env.PUSH == 'true' | |
uses: github-actions-x/commit@722d56b8968bf00ced78407bbe2ead81062d8baa # [email protected] | |
with: | |
github-token: ${{ github.token }} | |
email: [email protected] | |
name: Github Action | |
push-branch: master | |
commit-message: Page update. |