From 8c935230265cbe65a6ca8c79d2e6e6a2d60f3b94 Mon Sep 17 00:00:00 2001 From: oluceps Date: Mon, 23 Dec 2024 17:33:11 +0800 Subject: [PATCH] ci(sync-upstream): fix missing env (#137) chore: cat final update result ci: adjust build test seq --- .github/workflows/sync-upstream.yml | 18 ++++++++++-------- main.nu | 1 + 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/sync-upstream.yml b/.github/workflows/sync-upstream.yml index 2c1bf2e..69e177e 100644 --- a/.github/workflows/sync-upstream.yml +++ b/.github/workflows/sync-upstream.yml @@ -74,16 +74,23 @@ jobs: git checkout -b sync-target git push -u origin sync-target + - name: Build + run: | + #!/usr/bin/env bash + set -exuo pipefail + nix build .#${{ inputs.project }}-${{ inputs.suffix }} + - name: Create Pull Request uses: actions/github-script@main with: github-token: ${{ steps.generate_token.outputs.token }} script: | + const { PROJECT, SUFFIX, REVISION } = process.env const { data: pull_request } = await github.rest.pulls.create({ owner: context.repo.owner, repo: context.repo.repo, - title: `chore(${project}): sync to refs/head/main`, - body: `This PR merges the \`${project}-${suffix}\` latest update from upstream.`, + title: `chore(${PROJECT}): sync to ${REVISION || "refs/head/main"}`, + body: `This PR merges the ${PROJECT}-${SUFFIX} latest update from upstream.`, head: 'sync-target', base: 'main', }); @@ -91,9 +98,4 @@ jobs: env: PROJECT: ${{ inputs.project }} SUFFIX: ${{ inputs.suffix }} - - - name: Build - run: | - #!/usr/bin/env bash - set -exuo pipefail - nix build .#${{ inputs.project }}-${{ inputs.suffix }} + REVISION: ${{ inputs.revision }} diff --git a/main.nu b/main.nu index e771620..9897c59 100755 --- a/main.nu +++ b/main.nu @@ -136,4 +136,5 @@ def "main sync" [ log info "save final file" $metadata | save ./metadata.json -f + cat ./metadata.json }