Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.6.2 #4472

Merged
merged 4 commits into from
Jun 5, 2024
Merged

v1.6.2 #4472

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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build engine Docker image and publish to Dockerhub

on:

Check warning on line 3 in .github/workflows/build-engine-docker-image-and-publish-to-dockerhub.yml

View workflow job for this annotation

GitHub Actions / Linting and tests / Lint entire project

3:1 [truthy] truthy value should be one of [false, true]
workflow_call:
inputs:
engine_version:
Expand All @@ -23,7 +23,8 @@
- 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 @@
# 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
@@ -1,6 +1,6 @@
name: On release published

on:

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

View workflow job for this annotation

GitHub Actions / Linting and tests / Lint entire project

3:1 [truthy] truthy value should be one of [false, true]
release:
types:
- published
Expand Down Expand Up @@ -37,7 +37,7 @@
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 @@
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
Loading