Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/actions/github-deployment-create/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ inputs:
required: true
state:
description: The Initial State to set right after creation
default: ""
git-sha:
description: SHA reference for deployment - will default to workflow SHA if not provided

outputs:
id:
Expand All @@ -24,13 +25,14 @@ runs:
env:
GH_TOKEN: ${{ inputs.github-token }}
TARGET_ENV: ${{ inputs.environment }}
TARGET_SHA: ${{ inputs.git-sha || github.sha }}
shell: bash
run: |
URL="/repos/$GITHUB_REPOSITORY/deployments"

echo "Creating deployment at $URL for sha $GITHUB_SHA and env $TARGET_ENV"
echo "Creating deployment at $URL for sha $TARGET_SHA and env $TARGET_ENV"
# use a json object to be able to empty the required_contexts array
CREATED="$(jq -n --arg ref "$GITHUB_SHA" --arg environment "$TARGET_ENV" '{ref: $ref, environment: $environment, "auto_merge": false, "required_contexts": []}' | gh api -X POST $URL --input -)"
CREATED="$(jq -n --arg ref "$TARGET_SHA" --arg environment "$TARGET_ENV" '{ref: $ref, environment: $environment, "auto_merge": false, "required_contexts": []}' | gh api -X POST $URL --input -)"
echo $CREATED

DEPLOYMENT_ID="$(echo $CREATED | jq -r ".id")"
Expand Down
2 changes: 2 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,8 @@ With proper concurrency logic in place, the latest run might have been cancelled

These actions create a [GitHub deployment](https://docs.github.com/en/rest/deployments/deployments) and allow updating its status. That can be useful to track progression on a workflow pipeline.

On creation, an optional git sha can be provided, otherwise the sha of the commit that triggered the workflow is used.

Sample usage:

```yaml
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v9.1.0
v9.2.0
Loading