Skip to content

Commit

Permalink
Initial commit, github action added to accept webhook and create new …
Browse files Browse the repository at this point in the history
…commit on contentful change

Signed-off-by: jasonbellONS <[email protected]>
  • Loading branch information
JasonBellONS committed Jun 17, 2024
1 parent 067892d commit 327933a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/contenful-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: deploy
on:
repository_dispatch:
types: [contentful_update]
permissions:
id-token: write
contents: read # This is required for actions/checkout
jobs:
commit_changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
persist-credentials: false
fetch-depth: 0

- name: Create changes from webhook payload
run: |
curl --request GET https://api.contentful.com/spaces/${{ github.event.client_payload.spaceID }}/users/ \
${{ github.event.client_payload.userID }} -H 'Authorization: Bearer ${{ secrets.CONTENTFUL_TOKEN }}' | \
jq '.firstName + " " + .lastName + "made a change to contentful"' > CONTENTFUL_CHANGELOG.md
- name: Commit and Push Changes
uses: actions-js/push:master
with:
github_token: ${{ secrets.CONTENTFUL_GITHUB_TOKEN }}
message: ${{ github.event.client_payload.commit_message }}
Empty file added CONTENTFUL_CHANGELOG.md
Empty file.

0 comments on commit 327933a

Please sign in to comment.