Skip to content

Commit e4fc626

Browse files
Update wrap action (python#80)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent dddb1c2 commit e4fc626

File tree

1 file changed

+17
-46
lines changed

1 file changed

+17
-46
lines changed

.github/workflows/wrap_branch.yml

+17-46
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,46 @@
1-
name: "Wrap all po files in branch"
1+
name: "Wrap All"
22

3-
on: workflow_dispatch
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 0 15 * *'
47

58
jobs:
69
wrap:
710
runs-on: ubuntu-latest
811
steps:
9-
# Checkout the latest code from the repo
1012
- name: Checkout repo
1113
uses: actions/checkout@v3
1214

13-
# Setup which version of Python to use
1415
- name: Set Up Python 3.11
1516
uses: actions/setup-python@v4
1617
with:
1718
python-version: "3.11"
1819

19-
# Update pip
20-
- name: Update pip
20+
# Upgrade pip
21+
- name: Upgrade pip
2122
run: python -m pip install --upgrade pip
2223

23-
# Install requirements.
24-
- name: Install requirements
25-
run: python -m pip install --upgrade -r requirements.txt
26-
2724
# Install dependencies
2825
- name: Install dependencies
29-
run: sudo apt install -y gettext
26+
run: python -m pip install --upgrade -r requirements.txt && sudo apt install -y gettext
3027

3128
# Wrap all po files
3229
- name: Wrap
3330
run: powrap *.po */*.po
3431

35-
- name: Sphinx lint
36-
run: |
37-
sphinx-lint *.po */*.po
38-
39-
# Detect changed files
40-
- name: Detect changed files
41-
run: echo "WRAPPED=$(git diff --name-only | tr '\n' ' ')" >> $GITHUB_ENV
42-
43-
# Commit changes
44-
- name: Commit changes
45-
run: |
46-
array=($WRAPPED)
47-
len=${#array[@]}
48-
if [[ $len -eq 0 ]]; then
49-
echo "No files to commit"
50-
echo "WRAPPED=False" >> $GITHUB_ENV
51-
else
52-
echo "Committing changes"
53-
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
54-
git config --local user.name "github-actions[bot]"
55-
git add ${WRAPPED}
56-
git commit -m "Wrap translations"
57-
echo "WRAPPED=True" >> $GITHUB_ENV
58-
fi
59-
6032
# Create pull request
6133
- name: Create Pull Request
62-
id: cpr
63-
uses: peter-evans/create-pull-request@v4
34+
uses: peter-evans/create-pull-request@v4.2.3
6435
with:
65-
token: ${{ secrets.GITHUB_TOKEN }}
66-
commit-message: Update report
67-
committer: GitHub <noreply@github.com>
68-
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
69-
signoff: false
70-
branch: ${{ github.ref_name }}_wrapped
36+
commit-message: 'Wrap all files on: ${{ github.ref_name }}'
37+
branch: ${{ github.ref_name }}-wrapped
7138
delete-branch: true
39+
committer: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
40+
author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
7241
title: 'Wrap branch: ${{ github.ref_name }}'
73-
body: Wrapped all translations on branch ${{ github.ref_name }}.
42+
body: 'Wrapped all files on branch: ${{ github.ref_name }}.'
7443
labels: wrap
75-
draft: false
44+
reviewers: |
45+
egeakman
46+
ardasak

0 commit comments

Comments
 (0)