-
Notifications
You must be signed in to change notification settings - Fork 23
64 lines (56 loc) · 1.99 KB
/
Copy pathsyncAction.yml
File metadata and controls
64 lines (56 loc) · 1.99 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Sync Action into Veracode
on:
push:
tags:
- v**
jobs:
sync:
runs-on: ubuntu-latest
name: Sync Integration Helper Repo
steps:
- name: Checkout integration-helper repo
uses: actions/checkout@v4
with:
path: integration-helper
- name: Checkout ghes-actions-integration repo
uses: actions/checkout@v4
with:
repository: veracode/ghes-actions-integration
token: ${{ secrets.PAT_TOKEN }}
path: ghes-actions-integration
persist-credentials: false
- name: Copy dist and action.yml files
run: |
cp -r integration-helper/dist ghes-actions-integration/actions/integration-helper/
cp integration-helper/action.yml ghes-actions-integration/actions/integration-helper/
- name: Create branch and push changes
run: |
cd ghes-actions-integration
git config user.name "veracode"
git config user.email "user@veracode.com"
BRANCH_NAME="sync-integration-helper-$(date +%s)"
git checkout -b $BRANCH_NAME
git add actions
# Only commit and push if there are changes
if ! git diff --cached --quiet; then
git commit -m "Sync Integration Helper dist and action.yml"
git push <https://x-access-token:${{> secrets.PAT_TOKEN }}@github.com/veracode/ghes-actions-integration.git $BRANCH_NAME
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
echo "CHANGES_MADE=true" >> $GITHUB_ENV
else
echo "No changes to commit"
echo "CHANGES_MADE=false" >> $GITHUB_ENV
fi
- name: Create Pull Request with GitHub CLI
if: env.CHANGES_MADE == 'true'
run: |
gh pr create \\
--repo veracode/ghes-actions-integration \\
--base main \\
--head ${{ env.BRANCH_NAME }} \\
--title "Sync latest changes from integration-helper repository" \\
--body "Sync from integration-helper repository
- Updated dist folder
- Updated action.yml file"
env:
GH_TOKEN: ${{ secrets.PAT_TOKEN }}