Follow up - 0798e7d47e
- moved from circle ci to github actions. Fixed bug: GITHUB_ACTOR is the user initiating the commit not the repository owner. Applied workaround to extract the repository owner from the GitHub Actions GITHUB_REPOSITORY ENV instead because there is no dedicated ENV for that.
This commit is contained in:
parent
51ce176c2d
commit
dd96c57f48
3 changed files with 8 additions and 8 deletions
4
.github/docker-image-build.sh
vendored
4
.github/docker-image-build.sh
vendored
|
@ -13,7 +13,9 @@ ZAMMAD_VERSION="$(git describe --tags | sed -e 's/-[a-z0-9]\{8,\}.*//g')"
|
||||||
echo "${DOCKER_PASSWORD}" | docker login --username="${DOCKER_USERNAME}" --password-stdin
|
echo "${DOCKER_PASSWORD}" | docker login --username="${DOCKER_USERNAME}" --password-stdin
|
||||||
|
|
||||||
# clone docker repo
|
# clone docker repo
|
||||||
git clone https://github.com/"${REPO_USER}"/"${DOCKER_GITHUB_REPOSITORY}"
|
DOCKER_REPOSITORY_CLONE_URL="https://github.com/${REPO_USER}/${DOCKER_GITHUB_REPOSITORY}"
|
||||||
|
echo "Cloning ${DOCKER_REPOSITORY_CLONE_URL}"
|
||||||
|
git clone "${DOCKER_REPOSITORY_CLONE_URL}"
|
||||||
|
|
||||||
# enter dockerfile dir
|
# enter dockerfile dir
|
||||||
cd "${REPO_ROOT}/${DOCKER_GITHUB_REPOSITORY}"
|
cd "${REPO_ROOT}/${DOCKER_GITHUB_REPOSITORY}"
|
||||||
|
|
|
@ -14,9 +14,8 @@ jobs:
|
||||||
DOCKER_REPOSITORY: "zammad-docker-compose"
|
DOCKER_REPOSITORY: "zammad-docker-compose"
|
||||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||||
steps:
|
steps:
|
||||||
- name: Alias GITHUB_ACTOR as REPO_USER
|
- name: Extract REPO_USER from GITHUB_REPOSITORY ENV
|
||||||
run: |
|
run: echo "::set-env name=REPO_USER::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $1}')"
|
||||||
echo "::set-env name=REPO_USER::$GITHUB_ACTOR"
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@master
|
||||||
- name: Fetch all history for all tags and branches
|
- name: Fetch all history for all tags and branches
|
||||||
|
|
5
.github/workflows/build-docker-image.yaml
vendored
5
.github/workflows/build-docker-image.yaml
vendored
|
@ -14,9 +14,8 @@ jobs:
|
||||||
DOCKER_REPOSITORY: "zammad"
|
DOCKER_REPOSITORY: "zammad"
|
||||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||||
steps:
|
steps:
|
||||||
- name: Alias GITHUB_ACTOR as REPO_USER
|
- name: Extract REPO_USER from GITHUB_REPOSITORY ENV
|
||||||
run: |
|
run: echo "::set-env name=REPO_USER::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $1}')"
|
||||||
echo "::set-env name=REPO_USER::$GITHUB_ACTOR"
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@master
|
||||||
- name: Fetch all history for all tags and branches
|
- name: Fetch all history for all tags and branches
|
||||||
|
|
Loading…
Reference in a new issue