Skip to content

update_repo_status_data #1226

update_repo_status_data

update_repo_status_data #1226

name: update_repo_status_data
on:
workflow_dispatch:
schedule:
- cron: "0 * * * *"
jobs:
get_config_values:
uses: NHSDigital/eps-common-workflows/.github/workflows/get-repo-config.yml@383f3f9eaf3cb553ebcd74897bfed4d5e387629e
update_repo_status:
runs-on: ubuntu-22.04
needs: [get_config_values]
container:
image: ${{ needs.get_config_values.outputs.pinned_image }}
options: --user 1001:1001 --group-add 128
defaults:
run:
shell: bash
permissions:
id-token: write
contents: write
steps:
- name: copy .tool-versions
run: |
cp /home/vscode/.tool-versions "$HOME/.tool-versions"
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: make install
run: |
make install
- name: Generate a token to get details from other repositories
id: generate-token
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf
with:
app-id: ${{ vars.EPS_REPO_STATUS_APP_ID }}
private-key: ${{ secrets.EPS_REPO_STATUS_PEM }}
owner: "NHSDigital"
- shell: bash
name: get_repo_status
run: |
poetry run python scripts/run_repo_status.py --output /tmp/repo_status.json
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
- name: Checkout gh-pages
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
ref: gh-pages
path: gh-pages
- name: Update release tag in github pages
run: |
cd gh-pages
cp /tmp/repo_status.json _data/repo_status.json
git config user.name github-actions
git config user.email github-actions@github.com
git add "_data/repo_status.json"
git commit -m "update repo status"
parallel --retries 10 --delay 3 ::: "git pull --rebase && git push"