1414 - " .github/workflows/build-mysql-container.yaml"
1515 - " !**.md"
1616
17+ permissions : {}
18+
1719jobs :
1820 filter :
1921 runs-on : ubuntu-24.04
22+ permissions :
23+ contents : read
2024 outputs :
2125 mysql-versions : ${{ steps.filter.outputs.mysql-versions }}
2226 steps :
4246 if : ${{ (github.event_name == 'pull_request') && (needs.filter.outputs.mysql-versions != '[]') }}
4347 needs : filter
4448 runs-on : ${{ vars.IMAGE_BUILD_RUNNER || 'ubuntu-22.04' }}
49+ permissions :
50+ contents : read
4551 strategy :
4652 matrix :
4753 mysql-version : ${{ fromJson(needs.filter.outputs.mysql-versions) }}
5965 - name : Export TAG file
6066 id : tag
6167 working-directory : containers
68+ env :
69+ MYSQL_VERSION : ${{ matrix.mysql-version }}
6270 run : |
63- TAG=$(cat ./mysql/${{ matrix.mysql-version }} /TAG)
71+ TAG=$(cat " ./mysql/$MYSQL_VERSION /TAG" )
6472 echo "tag: $TAG"
6573 echo "tag=$TAG" >> "$GITHUB_OUTPUT"
6674
8088 && chmod +x container-structure-test-linux-amd64 \
8189 && sudo mv container-structure-test-linux-amd64 /usr/local/bin/container-structure-test
8290 - name : Run Container Structure Tests
91+ env :
92+ MYSQL_VERSION : ${{ matrix.mysql-version }}
8393 run : |
84- container-structure-test test --image ghcr.io/cybozu-go/moco/mysql:${{ matrix.mysql-version }} -- config ./containers/mysql/${{ matrix.mysql-version }} /container-structure-test.yaml
94+ container-structure-test test --image " ghcr.io/cybozu-go/moco/mysql:$MYSQL_VERSION" -- config " ./containers/mysql/$MYSQL_VERSION /container-structure-test.yaml"
8595
8696 - run : |
8797 swapon > swapon.txt
@@ -93,7 +103,10 @@ jobs:
93103 uses : ./.github/actions/setup-aqua
94104
95105 - name : Setup test cluster with local mysql image
96- run : make start KUBERNETES_VERSION=${{ matrix.k8s-version }} MYSQL_VERSION=${{ matrix.mysql-version }} KIND_CONFIG=kind-config_actions.yaml USE_LOCAL_MYSQL_IMAGE=1
106+ env :
107+ KUBERNETES_VERSION : ${{ matrix.k8s-version }}
108+ MYSQL_VERSION : ${{ matrix.mysql-version }}
109+ run : make start KUBERNETES_VERSION="$KUBERNETES_VERSION" MYSQL_VERSION="$MYSQL_VERSION" KIND_CONFIG=kind-config_actions.yaml USE_LOCAL_MYSQL_IMAGE=1
97110 working-directory : e2e
98111
99112 - run : make test
@@ -111,6 +124,9 @@ jobs:
111124 if : ${{ (github.ref == 'refs/heads/main') && (needs.filter.outputs.mysql-versions != '[]') }}
112125 needs : filter
113126 runs-on : ${{ vars.IMAGE_BUILD_RUNNER || 'ubuntu-22.04' }}
127+ permissions :
128+ contents : read
129+ packages : write
114130 strategy :
115131 matrix :
116132 mysql-version : ${{ fromJson(needs.filter.outputs.mysql-versions) }}
@@ -128,8 +144,10 @@ jobs:
128144 - name : Export TAG file
129145 id : tag
130146 working-directory : containers
147+ env :
148+ MYSQL_VERSION : ${{ matrix.mysql-version }}
131149 run : |
132- TAG=$(cat ./mysql/${{ matrix.mysql-version }} /TAG)
150+ TAG=$(cat " ./mysql/$MYSQL_VERSION /TAG" )
133151 echo "tag: $TAG"
134152 echo "tag=$TAG" >> "$GITHUB_OUTPUT"
135153
0 commit comments