generated from Sage-Bionetworks/data-models
-
Notifications
You must be signed in to change notification settings - Fork 3
54 lines (45 loc) · 1.81 KB
/
generate-current-manifests.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
42
43
44
45
46
47
48
49
50
51
52
53
54
# This workflow automatically generates all manifests currently specified by the data model
# Outputs are excel files and json schemas
# Runs AFTER changes to the data model have been reviewed in a PR and merged into main
name: Store Current Manifests
on:
push:
branches: main
# runs on changes to data model
paths: 'AD.model.jsonld'
workflow_dispatch:
jobs:
generate:
name: generate-manifests
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
SCHEMATIC_SERVICE_ACCOUNT_CREDS: ${{ secrets.SCHEMATIC_SERVICE_ACCOUNT_CREDS }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
token: ${{ secrets.GENERATE_MANIFESTS_ON_ACTION }} # this Fine-grained PAT was generated to generate manifests despite branch protection, was granted "Read and Write access to actions" permissions, and has access to the adknowledgeportal/data-models repo (resource owner is adknowledgeportal)
- name: Install Libraries
shell: bash
run: pip install -r requirements.txt
- name: Switch to branch
shell: bash
run: |
git checkout -b new-branch
- name: Generate all manifests
working-directory: tests
run: ./generate_all_templates.sh
- name: Commit and open PR
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git add --all
git commit -m "GitHub Action: generate latest manifests" || echo "No changes to commit"
gh pr create --title --body --base main --head new-branch
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}