We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
artifact.uploadArtifact
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling artifactClient.uploadArtifact results in the following error:
artifactClient.uploadArtifact
Error: Unable to get the ACTIONS_RUNTIME_TOKEN env variable
name: FooBar run-name: 'FooBar' on: pull_request: branches: - master types: [opened, synchronize, reopened, ready_for_review] jobs: exec-script: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: '16' - name: Install dependencies run: npm ci - name: Execute the script run: node ./scripts/my-script.mjs env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BASE_STATS_PATH: ./base/stats.json CURRENT_STATS_PATH: ./current/stats.json
import { DefaultArtifactClient } from '@actions/artifact' import * as core from '@actions/core' import { context, getOctokit } from '@actions/github' import { createHTMLArtifact } from '@bundle-stats/cli-utils' import { createJobs, createReport } from '@bundle-stats/utils' import { readFile, writeFile } from 'fs/promises' import process from 'node:process' const { repo: { owner, repo: repoName }, issue: { number: prNumber }, } = context const githubToken = getEnv('GITHUB_TOKEN') const baseStatsPath = getEnv('BASE_STATS_PATH') const currentStatsPath = getEnv('CURRENT_STATS_PATH') const octokit = getOctokit(githubToken) const artifactClient = new DefaultArtifactClient() ;(async () => { // ... // Generate the report const bundleStatsHTML = createHTMLArtifact(jobs, report) await writeFile('bundle-stats.html', bundleStatsHTML) core.info('Uploading artifact') try { const { id: artifactId } = await artifactClient.uploadArtifact('bundle-stats-html', ['./bundle-stats.html'], './') if (!artifactId) { core.setFailed('Failed to upload artifact') return } } catch (error) { console.error(error) } // Create comment and so on... // ... })()
I'm unsure why calling artifactClient.uploadArtifact results in the error:
Do I need to manually set this environment variable? Or is there something missing in my workflow setup?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the Problem
Calling
artifactClient.uploadArtifact
results in the following error:The Workflow File
Script File
Question
I'm unsure why calling
artifactClient.uploadArtifact
results in the error:Do I need to manually set this environment variable? Or is there something missing in my workflow setup?
The text was updated successfully, but these errors were encountered: