Skip to content

Commit 6bf2443

Browse files
Merge pull request #19 from wp-portugal/dev
Improve and fix workflow
2 parents b8ed3cd + e19677b commit 6bf2443

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/update-build-files.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ name: Update WordPress i18n build files
22

33
on:
44
schedule:
5-
- cron: "0 0 * * *" # Funciona todos os dias à meia-noite.
5+
- cron: "0 0 * * *" # Runs every day at midnight.
66

77
# Allows you to run this workflow manually from the Actions tab.
88
workflow_dispatch:
99

1010
env:
1111
OWNER: ${{ github.repository_owner }}
1212
REPO: ${{ github.repository }}
13-
TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
GH_TOKEN: "${{ github.token }}"
1414

1515
permissions:
1616
contents: write
@@ -52,6 +52,9 @@ jobs:
5252
if ! cmp -s downloads/readme.html en_US/readme.html || ! cmp -s downloads/wp-config-sample.php en_US/wp-config-sample.php; then
5353
echo "The build files have been updated!"
5454
echo "files_changed=true" >> $GITHUB_OUTPUT
55+
else
56+
echo "The build files remain unchanged."
57+
echo "files_changed=false" >> $GITHUB_OUTPUT
5558
fi
5659
5760
- name: Save workspace files to artifact
@@ -104,10 +107,11 @@ jobs:
104107

105108
steps:
106109

110+
- name: Checkout repository
111+
uses: actions/checkout@v4
112+
107113
- name: Check if Pull Request exists
108114
id: check_pr
109-
env:
110-
GH_TOKEN: "${{ github.token }}"
111115
run: |
112116
PR_NUMBER="$(gh pr list --head "${OWNER}:english" --json "number" --jq '.[0]."number"')"
113117
if [ -n "$PR_NUMBER" ]; then
@@ -123,7 +127,6 @@ jobs:
123127
env:
124128
TITLE: "Actualizar ficheiros originais em inglês"
125129
BODY: "Actualização automática para submeter alterações do branch 'english' para o 'main'."
126-
GH_TOKEN: "${{ github.token }}"
127130
run: |
128131
gh pr create --title "${TITLE}" --body "${BODY}" --head "english" --base "main"
129132

0 commit comments

Comments
 (0)