Skip to content

Commit

Permalink
Merge pull request #33 from devops-infra/bugfix/org-name
Browse files Browse the repository at this point in the history
Fix organization_domain input evaluation.
  • Loading branch information
ChristophShyper authored Feb 24, 2022
2 parents 1a3139b + c132ea9 commit 8031a91
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
phony: help

# Release tag for the action
VERSION := v0.6
VERSION := v0.7

# GitHub Actions bogus variables
GITHUB_REF ?= refs/heads/null
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
run: |
find . -type f -name "*" -print0 | xargs -0 sed -i "s/foo/bar/g"
- name: Commit and push changes
uses: devops-infra/action-commit-push@v0.6
uses: devops-infra/action-commit-push@v0.7
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
commit_message: Replaced foo with bar
Expand All @@ -101,7 +101,7 @@ jobs:
run: |
find . -type f -name "*" -print0 | xargs -0 sed -i "s/foo/bar/g"
- name: Commit and push changes
uses: devops-infra/action-commit-push@v0.6
uses: devops-infra/action-commit-push@v0.7
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
commit_prefix: "[AUTO-COMMIT] foo/bar replace"
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ outputs:
description: Name of the branch code was pushed into
runs:
using: docker
image: docker://devopsinfra/action-commit-push:v0.6
image: docker://devopsinfra/action-commit-push:v0.7
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
branding:
Expand Down
11 changes: 3 additions & 8 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ echo " commit_prefix: ${INPUT_COMMIT_PREFIX}"
echo " commit_message: ${INPUT_COMMIT_MESSAGE}"
echo " target_branch: ${INPUT_TARGET_BRANCH}"
echo " add_timestamp: ${INPUT_ADD_TIMESTAMP}"
echo " organization_domain: ${INPUT_ORG_DOMAIN}"
echo " organization_domain: ${INPUT_ORGANIZATION_DOMAIN}"
echo " force: ${INPUT_FORCE}"

# Require github_token
Expand Down Expand Up @@ -48,9 +48,9 @@ if [[ (-n "${INPUT_TARGET_BRANCH}" || "${INPUT_ADD_TIMESTAMP}" == "true") && -n
fi

# Set git credentials
git remote set-url origin "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@${INPUT_ORG_DOMAIN}/${GITHUB_REPOSITORY}"
git remote set-url origin "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@${INPUT_ORGANIZATION_DOMAIN}/${GITHUB_REPOSITORY}"
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.${INPUT_ORG_DOMAIN}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.${INPUT_ORGANIZATION_DOMAIN}"

# Create an auto commit
if [[ -n ${FILES_CHANGED} ]]; then
Expand All @@ -63,11 +63,6 @@ if [[ -n ${FILES_CHANGED} ]]; then
else
git commit -am "Files changed:" -m "${FILES_CHANGED}" --allow-empty
fi
if [[ "${INPUT_FORCE}" == "true" ]]; then
git push origin "${BRANCH}" --force
else
git push origin "${BRANCH}"
fi
fi

# Push
Expand Down

0 comments on commit 8031a91

Please sign in to comment.