ci: multi encoding source code #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: multi_encoding_converter | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
paths: | |
- "src/**.sas" | |
- "multi_encoding_converter.py" | |
permissions: | |
contents: write | |
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 }} |