From 700a63f03921d29c2b749121295d45f096bed4ac Mon Sep 17 00:00:00 2001 From: Adam Bannach <113929542+abannachGrafana@users.noreply.github.com> Date: Sun, 20 Apr 2025 23:07:46 -0500 Subject: [PATCH 1/2] chore: add release-please workflow fix dependabot config --- .github/dependabot.yml | 13 +------------ .github/workflows/release-please.yml | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/release-please.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2b96f2f..8f21dbf 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,15 +3,4 @@ updates: - package-ecosystem: 'github-actions' directory: '/' schedule: - interval: 'weekly' - - - package-ecosystem: 'npm' - directory: '/' - schedule: - interval: 'weekly' - pull-request-branch-name: - separator: '-' - ignore: - - dependency-name: '*' - update-types: - - 'version-update:semver-major' + interval: 'weekly' \ No newline at end of file diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..95b2337 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,19 @@ +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +name: release-please + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: googleapis/release-please-action@v4 + with: + config-file: release-please-config.json + manifest-file: .release-please-manifest.json \ No newline at end of file From 2bfd6c497ff7e01553d7e1f3f52b5b1e08ad8cee Mon Sep 17 00:00:00 2001 From: Adam Bannach <113929542+abannachGrafana@users.noreply.github.com> Date: Sun, 20 Apr 2025 23:09:39 -0500 Subject: [PATCH 2/2] chore: remove update changelog --- .github/workflows/update-changelog.yml | 81 -------------------------- 1 file changed, 81 deletions(-) delete mode 100644 .github/workflows/update-changelog.yml diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml deleted file mode 100644 index fd93e03..0000000 --- a/.github/workflows/update-changelog.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: Update Changelog - -on: - pull_request: - branches: - - main - types: [closed] -jobs: - update_changelog: - permissions: - id-token: write - contents: write - pull-requests: write - runs-on: ubuntu-latest - if: github.event.pull_request.merged == true && github.actor != 'github-actions[bot]' && github.actor != 'dependabot[bot]' - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - # We want to update our changelog on main - ref: 'main' - - - name: Install utilities - run: sudo apt-get install jq - - - name: Get PR information - id: pr - uses: octokit/request-action@dad4362715b7fb2ddedf9772c8670824af564f0d # v2.4.0 - with: - route: GET /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Update Changelog - run: | - BRANCH_NAME="update-changelog-$(date +%s)" - - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' - - git checkout -b $BRANCH_NAME - git push --set-upstream origin $BRANCH_NAME - - PR_LINE=$(node .github/workflows/scripts/get-changelog-line.js) - sed -i "/## Unreleased/ a $PR_LINE" CHANGELOG.md - git add CHANGELOG.md - env: - PR_DATA: ${{ steps.pr.outputs.data }} - - - name: Commit changes - uses: grafana/github-api-commit-action@41fe732f3adb869c954416c517c0fd7b90c60c5e # v0.3.1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: 'chore: update changelog [bot]' - - - name: Create pull request - id: cpr - run: | - PR_URL=$(gh pr create --title "chore: update changelog [bot]" --body "PR created automatically through update-changelog.yml workflow") - gh pr merge --auto --squash "$PR_URL" - echo "PR_URL=$PR_URL" >> $GITHUB_OUTPUT - env: - GH_TOKEN: ${{ github.token }} - - - id: get-secrets - uses: grafana/shared-workflows/actions/get-vault-secrets@main - with: - repo_secrets: | - GITHUB_APP_ID=helper-bot:app-id - GITHUB_APP_PRIVATE_KEY=helper-bot:private-key - - - uses: actions/create-github-app-token@v2 - id: app-token - with: - app-id: ${{ env.GITHUB_APP_ID }} - private-key: ${{ env.GITHUB_APP_PRIVATE_KEY }} - - - name: Approve PR - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{steps.cpr.outputs.PR_URL}} - GH_TOKEN: ${{ steps.app-token.outputs.token }}