chore(deps): update dependency axios to v1.18.1 #1091
Workflow file for this run
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
| --- | |
| # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
| name: Streamarr CI | |
| on: | |
| pull_request: | |
| branches: | |
| - '*' | |
| push: | |
| branches: | |
| - develop | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| env: | |
| DOCKER_HUB: nickelsh1ts/streamarr | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| i18n: | |
| name: i18n Check | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GH_REPO: ${{ github.repository }} | |
| NUMBER: ${{ github.event.pull_request.number }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| with: | |
| persist-credentials: false | |
| - name: Install and Enable Corepack | |
| run: npm install -g corepack --force && corepack enable | |
| - name: Install dependencies | |
| env: | |
| CYPRESS_INSTALL_BINARY: '0' | |
| run: pnpm install --frozen-lockfile | |
| - name: i18n Check | |
| shell: bash | |
| env: | |
| I18N_LABEL: i18n-out-of-sync | |
| BODY: | | |
| The i18n check failed because translation messages are out of sync. | |
| This usually happens when you've added or modified translation strings in your code but haven't updated the translation file. | |
| Please run `pnpm i18n:extract` and commit the changes. | |
| run: | | |
| retry() { n=0; until "$@"; do n=$((n+1)); [ $n -ge 3 ] && break; echo "retry $n: $*" >&2; sleep 2; done; } | |
| check_failed=0; pnpm i18n:extract || check_failed=$? | |
| if [ "$check_failed" -eq 0 ]; then | |
| git diff --exit-code src/i18n/locale/en.json || check_failed=1 | |
| fi | |
| pr_labels=$(gh pr view "$NUMBER" -R "$GH_REPO" --json labels -q '.labels[].name' 2>/dev/null) || true | |
| has_label=0 | |
| while IFS= read -r name; do [ -n "$name" ] && [ "$name" = "$I18N_LABEL" ] && has_label=1 && break; done <<< "$pr_labels" | |
| if [ "$check_failed" -ne 0 ]; then | |
| [ "$has_label" -eq 0 ] && { retry gh pr edit "$NUMBER" -R "$GH_REPO" --add-label "$I18N_LABEL" || true; retry gh pr comment "$NUMBER" -R "$GH_REPO" -b "$BODY" || true; } | |
| else | |
| [ "$has_label" -eq 1 ] && retry gh pr edit "$NUMBER" -R "$GH_REPO" --remove-label "$I18N_LABEL" || true | |
| fi | |
| exit $check_failed | |
| test: | |
| name: Prepare & Test Build | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| container: node:26-alpine@sha256:9c0e1e52125d6b67d505cf75b4880fcf1290ccea5c480849910e1d57b2cf72b5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| with: | |
| persist-credentials: false | |
| - name: Install and Enable Corepack | |
| run: npm install -g corepack --force && corepack enable | |
| - name: Install dependencies | |
| env: | |
| CYPRESS_INSTALL_BINARY: '0' | |
| run: pnpm install --frozen-lockfile | |
| - name: Prepare | |
| run: pnpm check | |
| - name: Build | |
| run: pnpm build | |
| build: | |
| name: Build (${{ matrix.arch }}) | |
| if: github.event_name != 'pull_request' | |
| strategy: | |
| matrix: | |
| include: | |
| - runner: ubuntu-24.04 | |
| platform: linux/amd64 | |
| arch: amd64 | |
| - runner: ubuntu-24.04-arm | |
| platform: linux/arm64 | |
| arch: arm64 | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| with: | |
| persist-credentials: false | |
| - name: Commit timestamp | |
| id: ts | |
| run: echo "TIMESTAMP=$(git log -1 --pretty=%ct)" >> "$GITHUB_OUTPUT" | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4 | |
| - name: Warm cache (no push) — ${{ matrix.platform }} | |
| uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| platforms: ${{ matrix.platform }} | |
| push: false | |
| build-args: | | |
| COMMIT_TAG=${{ github.sha }} | |
| SOURCE_DATE_EPOCH=${{ steps.ts.outputs.TIMESTAMP }} | |
| cache-from: type=gha,scope=${{ matrix.platform }} | |
| cache-to: type=gha,mode=max,scope=${{ matrix.platform }} | |
| provenance: false | |
| publish: | |
| name: Publish multi-arch image | |
| needs: build | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| with: | |
| persist-credentials: false | |
| - name: Commit timestamp | |
| id: ts | |
| run: echo "TIMESTAMP=$(git log -1 --pretty=%ct)" >> "$GITHUB_OUTPUT" | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_TOKEN }} | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6.1.0 | |
| with: | |
| images: | | |
| ${{ env.DOCKER_HUB }} | |
| ghcr.io/${{ github.repository }} | |
| tags: | | |
| type=raw,value=develop | |
| type=sha | |
| labels: | | |
| org.opencontainers.image.created=${{ steps.ts.outputs.TIMESTAMP }} | |
| - name: Build and push | |
| uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| build-args: | | |
| COMMIT_TAG=${{ github.sha }} | |
| SOURCE_DATE_EPOCH=${{ steps.ts.outputs.TIMESTAMP }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| cache-from: | | |
| type=gha,scope=linux/amd64 | |
| type=gha,scope=linux/arm64 | |
| cache-to: type=gha,mode=max | |
| provenance: false | |
| discord: | |
| name: Send Discord Notification | |
| needs: publish | |
| if: always() && github.event_name != 'pull_request' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get Build Job Status | |
| uses: technote-space/workflow-conclusion-action@45ce8e0eb155657ab8ccf346ade734257fd196a5 # v3 | |
| - name: Combine Job Status | |
| id: status | |
| run: | | |
| failures=(neutral skipped timed_out action_required) | |
| status="$WORKFLOW_CONCLUSION" | |
| for failure in "${failures[@]}"; do | |
| if [ "$WORKFLOW_CONCLUSION" = "$failure" ]; then | |
| status="failure" | |
| break | |
| fi | |
| done | |
| echo "status=$status" >> "$GITHUB_OUTPUT" | |
| - name: Post Status to Discord | |
| uses: sarisia/actions-status-discord@eb045afee445dc055c18d3d90bd0f244fd062708 # v1 | |
| with: | |
| webhook: ${{ secrets.DISCORD_WEBHOOK }} | |
| status: ${{ steps.status.outputs.status }} | |
| title: ${{ github.workflow }} | |
| nofail: true |