-
-
Notifications
You must be signed in to change notification settings - Fork 110
45 lines (43 loc) · 1.67 KB
/
slack-integration.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Automatic Slack Management
on:
push:
paths:
- '**/slack/**/*'
- 'MAINTAINERS.yaml'
- 'WORKING_GROUPS.yaml'
- '.github/workflows/slack-integration.yml'
jobs:
deploy-changes-to-slack:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Deploy changes to Slack
run: |
cd .github/workflows/slack
terraform init
terraform apply \
-var "slack_token=${{ secrets.SLACK_INFRA_TOKEN }}" \
-auto-approve
- name: Check if there are any uncommitted changes
id: git-check
run: |
# Set the output should_push to true if there are uncommitted changes
if [ -n "$(git status --porcelain)" ]; then
echo "Changes detected"
echo "should_push=true" >> $GITHUB_OUTPUT
else
echo "No changes detected"
echo "should_push=false" >> $GITHUB_OUTPUT
fi
- name: Push changes to GitHub
if: steps.git-check.outputs.should_push == 'true'
uses: peter-evans/create-pull-request@38e0b6e68b4c852a5500a94740f0e535e0d7ba54 # use 4.2.4 https://github.com/peter-evans/create-pull-request/releases/tag/v4.2.4
with:
token: ${{ secrets.GH_TOKEN }}
commit-message: 'chore(slack): update slack configuration'
committer: asyncapi-bot <[email protected]>
author: asyncapi-bot <[email protected]>
title: 'ci(slack): update slack configuration'
body: 'This PR was automatically created by the Automatic Slack Management GitHub Action.'
branch: 'chore/slack-update-${{ github.run_number }}'