CI: Add workaround for github uppercase usernames
The workflow defined in tools.yml and kernel.yml used to fail on forked repositories of contributers whose github username contains uppercase letters. A workaround mentioned in https://github.com/orgs/community/discussions/27086 and https://stackoverflow.com/questions/70326569/ is applied. Signed-off-by: Edward Chow <equu@openmail.cc> (cherry picked from commit c27b43956407f3adc3cc2693792acd6b40a01877)
This commit is contained in:
parent
daeb367dc1
commit
c2df98c49c
10
.github/workflows/kernel.yml
vendored
10
.github/workflows/kernel.yml
vendored
@ -13,11 +13,19 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
target: ${{ steps.find_targets.outputs.target }}
|
target: ${{ steps.find_targets.outputs.target }}
|
||||||
|
owner_lc: ${{ steps.lower_owner.outputs.owner_lc }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set lower case owner name
|
||||||
|
id: lower_owner
|
||||||
|
run: |
|
||||||
|
OWNER_LC=$(echo "${{ github.repository_owner }}" \
|
||||||
|
| tr '[:upper:]' '[:lower:]')
|
||||||
|
echo "::set-output name=owner_lc::$OWNER_LC"
|
||||||
|
|
||||||
- name: Set targets
|
- name: Set targets
|
||||||
id: find_targets
|
id: find_targets
|
||||||
run: |
|
run: |
|
||||||
@ -49,7 +57,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
target: ${{fromJson(needs.determine_targets.outputs.target)}}
|
target: ${{fromJson(needs.determine_targets.outputs.target)}}
|
||||||
|
|
||||||
container: ghcr.io/${{ github.repository_owner }}/tools:latest
|
container: ghcr.io/${{ needs.determine_targets.outputs.owner_lc }}/tools:latest
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
8
.github/workflows/tools.yml
vendored
8
.github/workflows/tools.yml
vendored
@ -167,6 +167,12 @@ jobs:
|
|||||||
packages: write
|
packages: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Set lower case owner name
|
||||||
|
env:
|
||||||
|
OWNER: ${{ github.repository_owner }}
|
||||||
|
run: |
|
||||||
|
echo "OWNER_LC=${OWNER,,}" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
@ -190,5 +196,5 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: openwrt
|
context: openwrt
|
||||||
push: true
|
push: true
|
||||||
tags: ghcr.io/${{ github.repository_owner }}/tools:latest
|
tags: ghcr.io/${{ env.OWNER_LC }}/tools:latest
|
||||||
file: openwrt/.github/workflows/Dockerfile.tools
|
file: openwrt/.github/workflows/Dockerfile.tools
|
||||||
|
Loading…
x
Reference in New Issue
Block a user