Skip to content

Commit

Permalink
Update news file
Browse files Browse the repository at this point in the history
  • Loading branch information
beeankha committed Mar 27, 2023
1 parent fe3781a commit 1c9fb83
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions .github/workflows/news.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Add News

on:
Expand All @@ -13,8 +14,7 @@ on:
jobs:
check:
if: >-
!github.event.repository.fork
&& (
!github.event.repository.fork && (
github.event.comment.body == '@conda-bot please add news'
|| github.event_name == 'pull_request_target'
)
Expand All @@ -31,11 +31,13 @@ jobs:
run: echo ${{ github.event.pull_request.number }}
id: pr_number

createFile:
name: Add news
runs-on: ubuntu-latest
steps:
- uses: 1arp/[email protected]
- name: Create File
if: contains(steps.check_comment.outputs.comment, 'please add news')
id: create_file
uses: actions/checkout@v2

- name: Populate File
uses: 1arp/[email protected]
with:
path: "news"
file: "${{ steps.pr_number }}-${{ steps.pr_branch_name }}"
Expand All @@ -59,3 +61,19 @@ jobs:
### Other
* <news item>
- name: Checkout Repository
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Commit File
if: steps.create_file.outputs
run: |
git config --local user.email [email protected]
git config --local user.name ${{ github.actor }}
git add .
git commit -m "Add news snippet"
git push
env:
github_token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 1c9fb83

Please sign in to comment.