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

github-actions: notify github commands for all the observability code #195219

Merged
merged 4 commits into from
Oct 7, 2024
Merged
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
30 changes: 6 additions & 24 deletions .github/workflows/oblt-github-commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,21 @@
name: oblt-github-commands

on:
pull_request_target:
pull_request:
types:
- opened
- labeled

permissions:
contents: read
pull-requests: write

jobs:
comment-if-oblt-member:
comment:
if: ${{ github.event.label.name == 'ci:project-deploy-observability' }}
runs-on: ubuntu-latest
steps:
- uses: elastic/apm-pipeline-library/.github/actions/github-token@current
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
v1v marked this conversation as resolved.
Show resolved Hide resolved
with:
url: ${{ secrets.OBLT_VAULT_ADDR }}
roleId: ${{ secrets.OBLT_VAULT_ROLE_ID }}
secretId: ${{ secrets.OBLT_VAULT_SECRET_ID }}

- id: is_team_member
name: Check if user is member of the Elastic org and Observability team
run: |
if gh api -H "Accept: application/vnd.github+json" \
/orgs/elastic/teams/observability/memberships/${{ github.actor }} ; then
echo "result=true" >> $GITHUB_OUTPUT
else
echo "result=false" >> $GITHUB_OUTPUT
fi
env:
GH_TOKEN: ${{ env.GITHUB_TOKEN }}

- if: ${{ steps.is_team_member.outputs.result == 'true' }}
uses: actions/github-script@v6
with:
github-token: ${{ env.GITHUB_TOKEN }}
script: |
const body = `
### :robot: GitHub comments
Expand Down
1 change: 1 addition & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"matchManagers": ["github-actions"],
"matchPackageNames": [
"actions/checkout",
"actions/github-script",
"elastic/github-actions/project-assigner",
"hmarr/auto-approve-action",
"octokit/graphql-action",
Expand Down