-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (47 loc) · 1.46 KB
/
multi_encoding_version.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
name: multi_encoding_converter
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- "src/**.sas"
- "multi_encoding_converter.py"
permissions:
pull-requests: write
defaults:
run:
shell: bash -e {0}
jobs:
convert:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Run converter
run: python multi_encoding_converter.py
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Check for changes
id: check_changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "has_changed=true" >> $GITHUB_OUTPUT
fi
- name: Commit changes
if: ${{ steps.check_changes.outputs.has_changed == 'true' }}
run: |
git add .
git commit -m "chore: multi encoding version"
git pull --rebase origin ${{ github.head_ref }}
git push origin HEAD:${{ github.head_ref }}
- name: Push changes
if: ${{ steps.check_changes.outputs.has_changed == 'true' }}
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}