Skip to content

Commit

Permalink
v1.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyorlando authored Jun 5, 2024
2 parents 5d4cf4c + e9e55f0 commit 507f28d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ jobs:
- name: Checkout project
uses: actions/checkout@v3
- name: Set engine version number in settings file
uses: ./.github/actions/set-engine-version-number-in-settings/action.yml
if: inputs.engine_version
uses: ./.github/actions/set-engine-version-in-settings
with:
working_directory: .
engine_version_number: ${{ inputs.engine_version }}
Expand All @@ -32,11 +33,12 @@ jobs:
# TODO: change back to grafana/shared-workflows once this PR is merged
# https://github.com/grafana/shared-workflows/pull/143
# uses: grafana/shared-workflows/actions/build-push-to-dockerhub@main
uses: joeyorlando/shared-workflows/actions/build-push-to-dockerhub@2cd8f06917d985a0f83176e6e439f69398c8d6e8
uses: joeyorlando/shared-workflows/actions/build-push-to-dockerhub@a5b95e1419bc78276cf74f0f8246e25192345b94
with:
context: engine/
push: true
platforms: linux/arm64/v8,linux/amd64
repository: grafana/oncall
tags: ${{ inputs.docker_image_tags }}
build-args: |
BUILDKIT_INLINE_CACHE=1
Expand Down
42 changes: 28 additions & 14 deletions .github/workflows/on-release-published.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
id: build-sign-and-package-plugin
uses: ./.github/actions/build-sign-and-package-plugin
with:
plugin_version_number: ${{ inputs.plugin_version_number }}
plugin_version_number: ${{ github.ref_name }}
grafana_access_policy_token: ${{ env.GRAFANA_ACCESS_POLICY_TOKEN }}
working_directory: grafana-plugin
- name: Authenticate with GCS
Expand Down Expand Up @@ -92,19 +92,33 @@ jobs:
with:
repo_secrets: |
GITHUB_API_KEY=github_actions:github-api-key
- name: Merge Helm release PR
# yamllint disable rule:line-length
- name: Slice v from the tag
id: prepare-version-tag
run: |
# Step 1. Fetch PRs from GitHub's API that're open and have a particular head ref indicative of a helm release PR
# API docs - https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#list-pull-requests
# NOTE: ${github.ref_name:1} will slice off the "v" prefix from the tag
echo processed-tag="${GITHUB_REF_NAME:1}" >> $GITHUB_OUTPUT
- name: Find Helm release pull request
uses: juliangruber/find-pull-request-action@v1
id: find-pull-request
with:
branch: helm-release/${{ steps.prepare-version-tag.outputs.processed-tag }}
- name: Merge pull Request
uses: juliangruber/merge-pull-request-action@v1
with:
github-token: ${{ env.GITHUB_API_KEY }}
number: ${{ steps.find-pull-request.outputs.number }}
# - name: Fetch PRs from GitHub's API

Check warning on line 109 in .github/workflows/on-release-published.yml

View workflow job for this annotation

GitHub Actions / Linting and tests / Lint entire project

109:7 [comments-indentation] comment not indented like content
# # yamllint disable rule:line-length
# run: |
# # Step 1. Fetch PRs from GitHub's API that're open and have a particular head ref indicative of a helm release PR

Check failure on line 112 in .github/workflows/on-release-published.yml

View workflow job for this annotation

GitHub Actions / Linting and tests / Lint entire project

112:121 [line-length] line too long (125 > 120 characters)
# # API docs - https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#list-pull-requests
# # NOTE: ${github.ref_name:1} will slice off the "v" prefix from the tag

curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $${{ env.GITHUB_API_KEY }}" -H "X-GitHub-Api-Version: 2022-11-28" "https://api.github.com/repos/grafana/oncall/pulls?head=grafana:helm-release/$${{ github.ref_name }}:1}&state=open" > prs.json
cat prs.json
# curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $${GITHUB_API_KEY }" -H "X-GitHub-Api-Version: 2022-11-28" "https://api.github.com/repos/grafana/oncall/pulls?head=grafana:helm-release/$${GITHUB_REF_NAME}:1}&state=open" > prs.json

Check failure on line 116 in .github/workflows/on-release-published.yml

View workflow job for this annotation

GitHub Actions / Linting and tests / Lint entire project

116:121 [line-length] line too long (268 > 120 characters)
# cat prs.json

# Step 2. Extract the PR number from the first PR in the list to be able to pass that to the next API call
cat prs.json | jq -r ".[0].number" > pr_number.txt
cat pr_number.txt
# Step 3. Merge the PR (https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#merge-a-pull-request)
cat pr_number.txt | xargs -r -I{pull_number} curl -L -X PUT -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $${{ env.GITHUB_API_KEY }}" -H "X-GitHub-Api-Version: 2022-11-28" "https://api.github.com/repos/grafana/oncall/pulls/{pull_number}/merge"
# yamllint enable rule:line-length
# # Step 2. Extract the PR number from the first PR in the list to be able to pass that to the next API call
# cat prs.json | jq -r ".[0].number" > pr_number.txt
# cat pr_number.txt
# # Step 3. Merge the PR (https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#merge-a-pull-request)

Check failure on line 122 in .github/workflows/on-release-published.yml

View workflow job for this annotation

GitHub Actions / Linting and tests / Lint entire project

122:121 [line-length] line too long (123 > 120 characters)
# cat pr_number.txt | xargs -r -I{pull_number} curl -L -X PUT -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $${{ env.GITHUB_API_KEY }}" -H "X-GitHub-Api-Version: 2022-11-28" "https://api.github.com/repos/grafana/oncall/pulls/{pull_number}/merge"

Check failure on line 123 in .github/workflows/on-release-published.yml

View workflow job for this annotation

GitHub Actions / Linting and tests / Lint entire project

123:121 [line-length] line too long (276 > 120 characters)
# # yamllint enable rule:line-length

0 comments on commit 507f28d

Please sign in to comment.