-
Notifications
You must be signed in to change notification settings - Fork 5
41 lines (37 loc) · 1.46 KB
/
import-metadata.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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 }}