build: experimenting -- do not merge #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Secrets Testing | |
| on: | |
| push: | |
| branches: [main,build-secrets-testing] | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| secrets-testing: | |
| name: Secrets Testing | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Write secret to file | |
| run: | | |
| cat > /tmp/test_secret.txt <<'EOF' | |
| <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd"> | |
| <localRepository/> | |
| <interactiveMode/> | |
| <offline/> | |
| <userName> | |
| ${{ secrets.NICKLAS_TEST_SECRET }} | |
| </userName> | |
| <servers/> | |
| <mirrors/> | |
| <proxies/> | |
| <profiles/> | |
| <!-- Never do this at home kids! --> | |
| <activeProfiles/> | |
| </settings> | |
| EOF | |
| - name: test secrets | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| target: secrets-testing.print | |
| push: false | |
| outputs: type=local,dest=./out | |
| secret-files: | | |
| test_secret=/tmp/test_secret.txt | |
| - name: Print extracted secret | |
| run: | | |
| echo "=== Extracted secret contents ===" | |
| cat ./out/secret.txt |