Skip to content

Update

Update #384

Workflow file for this run

"on":
schedule:
- cron: 0 12 * * *
workflow_dispatch: {}
name: Update
jobs:
update:
runs-on: ubuntu-latest
outputs:
hasUpdate: ${{ steps.update.outputs.hasUpdate }}
startSeq: ${{ steps.update.outputs.startSeq }}
endSeq: ${{ steps.update.outputs.endSeq }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: npm
node-version: 18
- run: npm ci
- run: node bin/cli.js
id: update
env:
GITHUB_APP_ID: ${{ vars.ALL_CONTRIBUTORS_IMPORT_APP_ID }}
GITHUB_PRIVATE_KEY: ${{ secrets.ALL_CONTRIBUTORS_IMPORT_APP_PRIVATE_KEY }}
- if: steps.update.outputs.hasUpdate
uses: actions/upload-artifact@v3
with:
name: endorsements.csv
path: data/endorsements.csv
- if: steps.update.outputs.hasUpdate
uses: actions/upload-artifact@v3
with:
name: source-files.csv
path: data/source-files.csv
handleUpdate:
needs: update
if: ${{ needs.update.outputs.hasUpdate }}
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app_id: ${{ vars.ALL_CONTRIBUTORS_IMPORT_APP_ID }}
private_key: ${{ secrets.ALL_CONTRIBUTORS_IMPORT_APP_PRIVATE_KEY }}
- uses: actions/checkout@v3
with:
token: ${{ steps.app-token.outputs.token }}
- uses: actions/setup-node@v3
with:
cache: npm
node-version: 18
- run: npm ci
- run: rm data/*
- uses: actions/download-artifact@v2
with:
name: endorsements.csv
path: data
- uses: actions/download-artifact@v2
with:
name: source-files.csv
path: data
# test integratity of data
- run: npm run test
# commit back to main branch
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_user_name: "all-contributors-import[bot]"
commit_user_email: "138532524+all-contributors-import[bot]@users.noreply.github.com"
commit_author: "all-contributors-import[bot] <138532524+all-contributors-import[bot]@users.noreply.github.com>"
commit_message: "data: update"
file_pattern: "data/*.csv"
# push data back to main
- run: node scripts/notify.js
env:
GITHUB_APP_ID: ${{ vars.ALL_CONTRIBUTORS_IMPORT_APP_ID }}
GITHUB_APP_PRIVATE_KEY: ${{ secrets.ALL_CONTRIBUTORS_IMPORT_APP_PRIVATE_KEY }}
START_SEQ: ${{ needs.update.outputs.startSeq }}
END_SEQ: ${{ needs.update.outputs.endSeq }}