Merge pull request 'chore: Fix workflows fail' (#19) from dev into master

Reviewed-on: #19
This commit is contained in:
fanantenana 2025-02-06 11:30:59 +00:00
commit 66eefb3a34

View File

@ -3,9 +3,10 @@ name: versioning-and-changelog
on: on:
pull_request: pull_request:
types: types:
- closed # Gitea utilise 'merged' et non 'closed' - closed
branches: branches:
- master - master
jobs: jobs:
versioning_and_changelog: versioning_and_changelog:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -35,6 +36,7 @@ jobs:
echo "Commits from merged PR:" echo "Commits from merged PR:"
echo "$COMMITS" echo "$COMMITS"
# On utilise GITHUB_ENV pour exporter la variable
echo "COMMITS<<EOF" >> "$GITHUB_ENV" echo "COMMITS<<EOF" >> "$GITHUB_ENV"
echo "$COMMITS" >> "$GITHUB_ENV" echo "$COMMITS" >> "$GITHUB_ENV"
echo "EOF" >> "$GITHUB_ENV" echo "EOF" >> "$GITHUB_ENV"
@ -49,7 +51,7 @@ jobs:
exit 1 exit 1
fi fi
CURRENT_VERSION=$(grep 'version:' $PUBSPEC_FILE | awk -F ': ' '{print $2}') CURRENT_VERSION=$(grep 'version:' "$PUBSPEC_FILE" | awk -F ': ' '{print $2}')
VERSION=$(echo "$CURRENT_VERSION" | cut -d'+' -f1) VERSION=$(echo "$CURRENT_VERSION" | cut -d'+' -f1)
BUILD=$(echo "$CURRENT_VERSION" | cut -d'+' -f2) BUILD=$(echo "$CURRENT_VERSION" | cut -d'+' -f2)
@ -196,8 +198,8 @@ jobs:
git config --global user.name "Gitea Actions" git config --global user.name "Gitea Actions"
git add pubspec.yaml CHANGELOG.md git add pubspec.yaml CHANGELOG.md
git commit -m "chore: increment version $NEW_VERSION+$NEW_BUILD and update changelog" git commit -m "chore: increment version $NEW_VERSION+$NEW_BUILD and update changelog" || echo "No changes to commit"
echo "🔗 Pushing changes..." echo "🔗 Pushing changes..."
# Ici, on pousse la branche courante (HEAD) vers la branche master sur l'origine # On pousse la branche courante (HEAD) vers master
git push origin HEAD:master git push origin HEAD:master