Skip to content

Commit 29ef202

Browse files
authored
[Reporting] extend chromium build Github action to support "contributor" author assoc (#220929)
## Summary Sorry for the noise, operation!! This PR includes the `CONTRIBUTOR` author association for the enablement trigger for the trigger chromium build Github action to resolve the issue with the action being skipped when it should not be [see](https://github.com/elastic/kibana/actions/runs/15118647340). I'd previously thought `MEMBER` was the way to go, and then `COLLABORATOR` but on digging into the event Github sent for issue related events for my user, I see that my author association is `CONTRIBUTOR` [see here](https://api.github.com/repos/elastic/kibana/issues/events/17718838304), making this change ensures that only users within the elastic organisation are able to kick off this action. In this PR also `jq` is leveraged to compact the json we expect in place of `sed`. ## Testing - install the [github local actions](https://sanjulaganepola.github.io/github-local-actions-docs/) vscode extension - copy the response from the linked api response, and save it's contents as your payload.json file - start the Github action, we'd see that the action is no logger skipped and we are able to kick off the build. <!-- ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... -->
1 parent 56f5a53 commit 29ef202

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/trigger-chromium-build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010

1111
jobs:
1212
matches_label:
13-
if: ${{ contains(github.event.issue.labels.*.name, 'trigger-chromium-build') && contains(fromJSON('["MEMBER", "COLLABORATOR"]'), github.event.issue.author_association) }}
13+
if: ${{ contains(github.event.issue.labels.*.name, 'trigger-chromium-build') && contains(fromJSON('["MEMBER", "COLLABORATOR", "CONTRIBUTOR"]'), github.event.issue.author_association) }}
1414
runs-on: ubuntu-latest
1515
outputs:
1616
version_bump_config: ${{ steps.extract_version_bump_config.outputs.result }}
@@ -61,7 +61,7 @@ jobs:
6161
local block_content=$3
6262
if [[ $lang == "json" ]]; then
6363
# Remove leading and trailing whitespace from the block content
64-
block_content=$(echo "$block_content" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
64+
block_content=$(echo "$block_content" | jq -c .)
6565
6666
# Check for puppeteer_version property
6767
if echo "$block_content" | jq -e 'has("puppeteer_version")' > /dev/null; then
@@ -81,7 +81,7 @@ jobs:
8181
mdsh-parse handle_code_block
8282
# Output the upgrade config if found
8383
if [[ -n "$UPGRADE_CONFIG" ]]; then
84-
echo "version_bump_config=$UPGRADE_CONFIG" >> $GITHUB_OUTPUT
84+
echo "result=$UPGRADE_CONFIG" >> $GITHUB_OUTPUT
8585
fi
8686
}
8787
@@ -126,4 +126,4 @@ jobs:
126126
GITHUB_ISSUE_NUMBER=${{ github.event.issue.number }}
127127
GITHUB_ISSUE_LABELS=${{ github.event.issue.labels }} | jq -r '. | map(.name) | join(",")'
128128
GITHUB_ISSUE_TRIGGER_USER=${{ github.event.issue.user.login }}
129-
PUPPETEER_VERSION=$(echo ${{ needs.matches_label.outputs.version_bump_config }} | jq -r '.puppeteer_version')
129+
PUPPETEER_VERSION=$(echo ${{ fromJSON(needs.matches_label.outputs.version_bump_config) }} | jq -r '.puppeteer_version')

0 commit comments

Comments
 (0)