-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (51 loc) · 1.74 KB
/
update-issue-tracker.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
55
56
57
58
59
60
61
62
name: Update Github Issues
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to update'
required: true
default: 'main'
schedule:
- cron: '0 0 * * *'
jobs:
Update-Github-Issues:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Show Inputs
run: |
echo "Selected branch: ${{ github.event.inputs.branch }}"
- uses: actions/checkout@v4
with:
submodules: "recursive"
ref: ${{ github.event.inputs.branch }} # Checkout the specified branch
- name: Validate branch exists
run: |
git fetch --all
if ! git rev-parse --verify "origin/${{ github.event.inputs.branch }}" > /dev/null 2>&1; then
echo "Branch '${{ github.event.inputs.branch }}' does not exist."
exit 1
fi
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: "yarn"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run
run: yarn update-github-issues
- name: Git commit and push
env:
CI_COMMIT_AUTHOR: Vortex Backend
CI_COMMIT_EMAIL: [email protected]
CI_COMMIT_MESSAGE: Update Github Issues
run: |
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
git config --global user.email "${{ env.CI_COMMIT_EMAIL }}"
git pull origin ${{ github.event.inputs.branch }} # Pull the latest changes from the branch
git add . # Add changes before committing
git commit -m "${{ env.CI_COMMIT_MESSAGE }}"
git push origin ${{ github.event.inputs.branch }} # Push changes to the specified branch