Skip to content

Commit 0c59ace

Browse files
committed
workflow updated
1 parent 83ff188 commit 0c59ace

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

.github/workflows/deploy.yml

+24-20
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,23 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v3
14+
15+
- name: Debug File List
16+
run: ls -R
17+
1418
- name: Install SVN (Subversion)
1519
run: |
1620
sudo apt-get update
1721
sudo apt-get install subversion
1822
19-
- name: WordPress Plugin Deploy
20-
id: deploy
21-
uses: 10up/action-wordpress-plugin-deploy@stable
22-
with:
23-
generate-zip: true
24-
2523
- name: Find Readme File
2624
id: find_readme
2725
run: |
28-
for file in README.txt README.md Readme.txt Readme.md readme.txt readme.md; do
29-
if [ -f "$file" ]; then
30-
echo "Readme file found: $file"
31-
echo "readme_file=$file" >> $GITHUB_ENV
32-
break
33-
fi
34-
done
35-
if [ -z "${{ env.readme_file }}" ]; then
26+
readme_file=$(find . -type f -iname "readme.*" | head -n 1)
27+
if [ -n "$readme_file" ]; then
28+
echo "Readme file found: $readme_file"
29+
echo "readme_file=$readme_file" >> $GITHUB_ENV
30+
else
3631
echo "::error::Readme file not found."
3732
exit 1
3833
fi
@@ -47,32 +42,41 @@ jobs:
4742
in_changelog=0
4843
release_notes=""
4944
while IFS= read -r line; do
50-
# Start extracting once we find the changelog section
5145
if [[ "$line" == "$changelog_section_start" ]]; then
5246
in_changelog=1
5347
continue
5448
fi
55-
56-
# Stop extracting if we reach another section or blank line
5749
if [[ $in_changelog -eq 1 && "$line" =~ ^== ]]; then
5850
break
5951
fi
60-
61-
# Add valid lines to the release notes
6252
if [[ $in_changelog -eq 1 && -n "$line" ]]; then
6353
release_notes+="$line\n"
6454
fi
6555
done < "$readme_file"
6656
67-
# Check if release notes were extracted
6857
if [[ -z "$release_notes" ]]; then
6958
echo "::error::Failed to extract release notes from the changelog section."
7059
exit 1
7160
fi
7261
62+
# Debug: Print extracted release notes
63+
echo "Extracted release notes:"
64+
echo "$release_notes"
65+
7366
# Set output
7467
echo "::set-output name=notes::$release_notes"
7568
69+
- name: Debug Release Notes
70+
run: |
71+
echo "Debugging Release Notes:"
72+
echo "${{ steps.release_notes.outputs.notes }}"
73+
74+
- name: WordPress Plugin Deploy
75+
id: deploy
76+
uses: 10up/action-wordpress-plugin-deploy@stable
77+
with:
78+
generate-zip: true
79+
7680
- name: Create GitHub Release
7781
uses: softprops/action-gh-release@v2
7882
with:

0 commit comments

Comments
 (0)