Skip to content

Commit a9cc13d

Browse files
ci: guard send-tweet workflow for forks and missing secrets\n\n- Run only on main branch\n- Restrict to upstream repo via github.repository\n- Remove failing condition checks that reference secrets in expressions
Signed-off-by: Prince Victor Orjiugo <orjiugo.victor@gmail.com>
1 parent cd62915 commit a9cc13d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/send-tweet.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
name: Send a Tweet
2-
on: [push]
2+
on:
3+
push:
4+
branches:
5+
- main
36
jobs:
47
tweet:
8+
# Only run in the upstream repo; secrets guard applied at step level
9+
if: github.repository == 'MichaelCade/90DaysOfDevOps'
510
runs-on: ubuntu-latest
611
steps:
7-
- uses: ethomson/send-tweet-action@v1
12+
- name: Send tweet
13+
uses: ethomson/send-tweet-action@v1
814
with:
915
status: "👋 Hey Everyone!. This is an automated message 🤖 to let you know that there has been an update on the #90DaysOfDevOps repository, Commit message (${{ github.event.head_commit.message }}) You can check it out https://github.com/MichaelCade/90DaysOfDevOps"
1016
consumer-key: ${{ secrets.TWITTER_CONSUMER_API_KEY }}

0 commit comments

Comments
 (0)