Update Metadata Files #763
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: Update Metadata Files | |
# Update the metadata information | |
on: | |
schedule: | |
- cron: "0 6 * * *" | |
workflow_dispatch: {} | |
jobs: | |
fetch-metadata: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
name: "Checkout repository" | |
- name: "Setup Node.js" | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 16 | |
- name: "Prepare collection of data from metadata repository" | |
run: | | |
cd .github/scripts | |
npm ci | |
- name: "Execute collection of data from metadata repository" | |
run: | | |
cd .github/scripts | |
export GH_ENTERPRISE_TOKEN=${{ secrets.GH_ENTERPRISE_TOKEN }} | |
export GH_ENTERPRISE_API_URL=${{ secrets.GH_ENTERPRISE_API_URL }} | |
export METADATA_SOURCE_VERSION=${{ secrets.METADATA_SOURCE_VERSION }} | |
export METADATA_SOURCE_DIR=${{ secrets.METADATA_SOURCE_DIR }} | |
export METADATA_SOURCE_REPO=${{ secrets.METADATA_SOURCE_REPO }} | |
export METADATA_SOURCE_OWNER=${{ secrets.METADATA_SOURCE_OWNER }} | |
npm run fetch:metadata | |
- name: "Store changes in GH repository" | |
run: | | |
git add -A | |
git config user.email "[email protected]" | |
git config user.name "BTP Metadata Repo Bot" | |
git diff --quiet && git diff --staged --quiet || git commit -m "[btpmr-bot] $(date '+%Y-%m-%d %H:%M:%S'): fetched BTP metadata" | |
git push origin ${{ github.ref_name }} |