Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI - Create Release
name: Create Release

on:
pull_request:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gitflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Gitflow Workflow
name: Gitflow

on:
push:
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
RELEASE_BRANCH=$(echo "${{ github.ref }}" | sed 's|refs/heads/||')

# Check if PR already exists (open, closed, or merged)
EXISTING_PR=$(gh pr list --base develop --head "$RELEASE_BRANCH" --json state --jq '.[] | select(.state == "OPEN" or .state == "MERGED" or .state == "CLOSED")')
EXISTING_PR=$(gh pr list --base main --head "$RELEASE_BRANCH" --json state --jq '.[] | select(.state == "OPEN" or .state == "MERGED" or .state == "CLOSED")')

if [ -n "$EXISTING_PR" ]; then
echo "PR from $RELEASE_BRANCH to develop already exists (open, closed, or merged). Skipping."
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trigger-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI - Trigger Release
name: Trigger Release

on:
release:
Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/update-version-package-json.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI - Update Version Package.json
name: Update Version Package.json

on:
pull_request:
Expand All @@ -9,6 +9,11 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write
pull-requests: write


jobs:
tag:
if: contains(github.head_ref, 'release/') && contains(github.base_ref, 'main')
Expand Down Expand Up @@ -37,6 +42,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Authenticate GitHub CLI
run: echo "${{ secrets.GH_PAT }}" | gh auth login --with-token

- name: Update version in package.json
run: |
jq '.version = "${{ env.TAG }}"' package.json > temp.json && mv temp.json package.json
Expand All @@ -45,10 +53,13 @@ jobs:
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "github-actions@github.com"

git checkout -B ${{ github.head_ref }} || git checkout -b ${{ github.head_ref }}

git add package.json
git commit -m "chore: update version to v${{ env.TAG }} in package.json"
git commit -m "chore: update version to '${{ env.TAG }}' in package.json"

# Configure o token de autenticação para o Git
git remote set-url origin https://x-access-token:${{ secrets.GH_PAT }}@github.com/${{ github.repository }}.git
git push origin ${{ github.head_ref }}
git pull origin ${{ github.head_ref }} --rebase

# Usar token para autenticação do git push
git push https://x-access-token:${{ secrets.GH_PAT }}@github.com/${{ github.repository }}.git ${{ github.head_ref }}
2 changes: 1 addition & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI-Validate
name: Validate
on:
pull_request:
branches: [ main, release, develop ]
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "timesheet-in-transit-api",
"version": "0.0.1",
"version": "0.0.2",
"description": "timesheet-in-transit-api",
"author": "Hemicharly Thiago",
"private": true,
Expand Down
Loading