diff --git a/.github/dependabot.yml b/.github/dependabot.yml index fef5dd8..39661f7 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,15 +3,22 @@ updates: - package-ecosystem: 'npm' directory: '/' schedule: - interval: 'weekly' + interval: 'monthly' target-branch: main + - package-ecosystem: 'composer' directory: '/' schedule: - interval: 'weekly' + interval: 'monthly' + ignore: + - dependency-name: "ralphjsmit/laravel-glide" + - dependency-name: '*' + update-types: + - 'version-update:semver-major' target-branch: main + - package-ecosystem: 'github-actions' directory: '/' schedule: - interval: 'weekly' + interval: 'monthly' target-branch: main diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index f53121d..78e16cc 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -22,13 +22,14 @@ jobs: id: get_workflow_token uses: peter-murray/workflow-application-token-action@v4 with: - application_id: ${{ vars.FUELVIEWS_BOT_APP_ID}} + application_id: ${{ vars.FUELVIEWS_BOT_APP_ID }} application_private_key: ${{ secrets.FUELVIEWS_BOT_APP_PRIVATE_KEY }} - uses: actions/checkout@v4 with: ref: 'main' fetch-depth: '0' + token: ${{ steps.get_workflow_token.outputs.token }} - name: Bump version and push tag id: bump_version @@ -38,6 +39,54 @@ jobs: DEFAULT_BUMP: patch WITH_V: true RELEASE_BRANCHES: main + BRANCH_HISTORY: last + + - name: Generate Release Notes + id: generate_release_notes + shell: bash + env: + TOKEN: ${{ steps.get_workflow_token.outputs.token }} + NEW_TAG: ${{ steps.bump_version.outputs.new_tag }} + OWNER: ${{ github.repository_owner }} + REPO: ${{ github.event.repository.name }} + run: | + response=$(curl -s -X POST \ + -H "Authorization: Bearer $TOKEN" \ + -H "Accept: application/vnd.github+json" \ + https://api.github.com/repos/$OWNER/$REPO/releases/generate-notes \ + -d @- <> $GITHUB_OUTPUT + echo "$body" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + - name: Update Changelog + uses: stefanzweifel/changelog-updater-action@v1 + with: + latest-version: ${{ steps.bump_version.outputs.new_tag }} + release-notes: ${{ steps.generate_release_notes.outputs.body }} + + - name: Commit updated CHANGELOG + env: + GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }} + run: | + git config user.name "fuelviews-app[bot]" + git config user.email "fuelviews-app[bot]@users.noreply.github.com" + git add CHANGELOG.md + git commit -m "Chore: update changelog for ${{ steps.bump_version.outputs.new_tag }} [skip ci]" + git push origin main - name: Release id: release @@ -46,5 +95,4 @@ jobs: GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }} with: tag_name: ${{ steps.bump_version.outputs.new_tag }} - generate_release_notes: true - + body: ${{ steps.generate_release_notes.outputs.body }} diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index 327df8a..5bea3d4 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: release: - types: [released] + types: [published] permissions: contents: write @@ -19,27 +19,27 @@ jobs: id: get_workflow_token uses: peter-murray/workflow-application-token-action@v4 with: - application_id: ${{ vars.FUELVIEWS_BOT_APP_ID}} + application_id: ${{ vars.FUELVIEWS_BOT_APP_ID }} application_private_key: ${{ secrets.FUELVIEWS_BOT_APP_PRIVATE_KEY }} - name: Checkout code uses: actions/checkout@v4 with: - ref: ${{ github.event.release.target_commitish }} + ref: 'main' token: ${{ steps.get_workflow_token.outputs.token }} - name: Update Changelog uses: stefanzweifel/changelog-updater-action@v1 with: - latest-version: ${{ github.event.release.name }} + latest-version: ${{ github.event.release.tag_name }} release-notes: ${{ github.event.release.body }} - - name: Amend latest commit with updated CHANGELOG + - name: Commit updated CHANGELOG + env: + GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }} run: | git config user.name "fuelviews-app[bot]" git config user.email "fuelviews-app[bot]@users.noreply.github.com" git add CHANGELOG.md - git commit --amend --no-edit - git push origin main --force-with-lease - env: - GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }} \ No newline at end of file + git commit -m "Update CHANGELOG for release ${{ github.event.release.tag_name }}" + git push origin main