Skip to content

Commit

Permalink
fix(ci): try to force a trigger when pushing from CI
Browse files Browse the repository at this point in the history
  • Loading branch information
e-picas committed Dec 18, 2023
1 parent 615028b commit 70c7d97
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
1 change: 1 addition & 0 deletions .github/workflows/bump_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@v3
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/make_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ jobs:
run: |
git pull
semantic-release --dry-run --no-ci
NEXT_VERSION=$(grep -Po 'Version:([ ]*)?(.*)' "style.css" | tr -s ' ' | cut -d' ' -f2)
export NEXT_VERSION=$(grep -Po 'Version:([ ]*)?(.*)' "style.css" | tr -s ' ' | cut -d' ' -f2)
git checkout -b "release-${NEXT_VERSION}"
sed -i "s/Version: .*/Version: release-${NEXT_VERSION}/" style.css
git add style.css
NEED_COMMIT=$(git diff --name-status --cached --exit-code 1>/dev/null; echo $?;)
if [[ $NEED_COMMIT == 1 ]]
then
git commit -m "ci(develop): preparing release branch release-${NEXT_VERSION}"
fi
git push origin release-${NEXT_VERSION}
git commit -m "ci(develop): preparing release branch release-${NEXT_VERSION}" || true
- name: Git push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
branch: release-${NEXT_VERSION}
21 changes: 10 additions & 11 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,20 @@ jobs:
git config user.name "github-ci-bot"
- name: Merging release
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
run: |
git fetch
git rev-parse --verify ${{ inputs.targetBranch }} && git branch -D ${{ inputs.targetBranch }}
git checkout --force --track origin/${{ inputs.targetBranch }}
git reset --hard origin/${{ inputs.targetBranch }}
git merge --no-ff --no-edit --no-commit origin/${{ github.ref_name }}
NEED_COMMIT=$(git diff --name-status --cached --exit-code 1>/dev/null; echo $?;)
if [[ $NEED_COMMIT == 1 ]]
then
git commit -m "ci(${{ github.ref_name }}): merging prepared release"
git push origin ${{ inputs.targetBranch }}
else
echo "> no changes to be commited on ${{ inputs.targetBranch }}"
echo "> no new release to bump"
fi
# delete release branch
git branch -D ${{ github.ref_name }}
git commit -m "ci(${{ github.ref_name }}): merging prepared release" \
|| echo "> no changes to be commited on ${{ inputs.targetBranch }} - no new release to bump"
git push --delete origin ${{ github.ref_name }}
- name: Git push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
branch: ${{ inputs.targetBranch }}

0 comments on commit 70c7d97

Please sign in to comment.