-
Notifications
You must be signed in to change notification settings - Fork 181
30 lines (27 loc) · 1.18 KB
/
process-pipelines.yml
File metadata and controls
30 lines (27 loc) · 1.18 KB
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
name: Process Pipelines
on:
push: {branches: main, paths: pipelines/**}
jobs:
pipeprocess:
runs-on: ubuntu-latest
steps:
- name: Create new branch and run script
uses: actions/checkout@v6
with:
ref: main
- run: |
git branch generate-file-branch-${{ github.run_id }}-${{ github.run_attempt }}
git push --set-upstream origin generate-file-branch-${{ github.run_id }}-${{ github.run_attempt }}
git checkout generate-file-branch-${{ github.run_id }}-${{ github.run_attempt }}
python .github/workflows/process.py
if [[ "$(git diff --exit-code ./pipelines/pipelines_index.json)" =~ 'diff' ]]; then echo "IS_VALID=true" >> $GITHUB_ENV; else echo "IS_VALID=false" >> $GITHUB_ENV ;fi
- if: ${{ env.IS_VALID == 'true' }}
run: |
git config --global user.email "vb-bot@google.com"
git config --global user.name "vb-bot"
git add .
git commit -m "Update pipelines_index.json"
git push
gh pr create -B main --title 'Update pipelines_index.json' --body 'Update pipelines index'
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}