-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github-actions: use GitHub secrets (#39646)
- Loading branch information
Showing
3 changed files
with
73 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ permissions: | |
contents: read | ||
|
||
env: | ||
EMAIL_VAULT_SECRET: secret/observability-team/ci/service-account/email-github-actions | ||
EMAIL: [email protected] | ||
URL_QUERY: 'https://github.com/elastic/beats/pulls?q=is%3Apr+is%3Aopen+label%3ATeam%3ABeats-On-Call' | ||
JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
|
@@ -56,37 +55,22 @@ jobs: | |
|
||
- if: ${{ contains(steps.search.outputs.found, 'true') }} | ||
name: Report obsoleted branches (slack) | ||
uses: elastic/apm-pipeline-library/.github/actions/slack-message@current | ||
uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0 | ||
with: | ||
url: ${{ secrets.VAULT_ADDR }} | ||
roleId: ${{ secrets.VAULT_ROLE_ID }} | ||
secretId: ${{ secrets.VAULT_SECRET_ID }} | ||
channel: "#ingest-notifications" | ||
message: ":red_circle: Elastic Stack version for the `${{ matrix.branch }}` branch has not been updated for a while (`> 7 days`). Review the (<${{ env.URL_QUERY }}|open PRs>)" | ||
|
||
- if: ${{ contains(steps.search.outputs.found, 'true') }} | ||
uses: hashicorp/[email protected] | ||
with: | ||
url: ${{ secrets.VAULT_ADDR }} | ||
roleId: ${{ secrets.VAULT_ROLE_ID }} | ||
secretId: ${{ secrets.VAULT_SECRET_ID }} | ||
method: approle | ||
secrets: | | ||
${{ env.EMAIL_VAULT_SECRET }} username | MAIL_USERNAME ; | ||
${{ env.EMAIL_VAULT_SECRET }} app_token | MAIL_PASSWORD; | ||
${{ env.EMAIL_VAULT_SECRET }} from | MAIL_FROM; | ||
${{ env.EMAIL_VAULT_SECRET }} reply | MAIL_REPLY; | ||
${{ env.EMAIL_VAULT_SECRET }} server | MAIL_SERVER | ||
channel-id: '#ingest-notifications' | ||
payload: ":red_circle: Elastic Stack version for the `${{ matrix.branch }}` branch has not been updated for a while (`> 7 days`). Review the (<${{ env.URL_QUERY }}|open PRs>)" | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
|
||
- if: ${{ contains(steps.search.outputs.found, 'true') }} | ||
name: Report obsoleted branches (email) | ||
uses: dawidd6/action-send-mail@6063705cefe50cb915fc53bb06d4049cae2953b2 | ||
with: | ||
server_address: ${{ env.MAIL_SERVER }} | ||
username: ${{ env.MAIL_USERNAME }} | ||
password: ${{ env.MAIL_PASSWORD }} | ||
server_address: ${{ secrets.MAIL_SERVER }} | ||
username: ${{ secrets.MAIL_USERNAME }} | ||
password: ${{ secrets.MAIL_PASSWORD }} | ||
subject: '[${{ matrix.branch }}] ${{ steps.date.outputs.date }}: Elastic Stack version has not been updated recently.' | ||
to: ${{ env.EMAIL }} | ||
from: ${{ env.MAIL_FROM }} | ||
reply_to: ${{ env.MAIL_REPLY }} | ||
from: ${{ secrets.MAIL_FROM }} | ||
reply_to: ${{ secrets.MAIL_REPLY }} | ||
body: 'Elastic Stack version for the ${{ matrix.branch }} branch has not been updated for a while (> 7 days). Review the open PRs in ${{ env.URL_QUERY }}. Generated automatically with ${{ env.JOB_URL }}' |