Skip to content

Commit e8bc797

Browse files
committed
Use the saved output instead of the saved files
1 parent 7a0ba12 commit e8bc797

2 files changed

Lines changed: 19 additions & 17 deletions

File tree

action.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ inputs:
3737
runs:
3838
using: "composite"
3939
steps:
40-
- id: save-importmap-outputs
41-
name: Save importmap outputs
40+
- id: run-importmaps
41+
name: Run importmap audit and outdated
4242
shell: bash
4343
working-directory: ${{ inputs.rails-root }}
4444
run: |
@@ -61,17 +61,19 @@ runs:
6161
shell: bash
6262
working-directory: ${{ github.action_path }}
6363
env:
64-
BUNDLE_GEMFILE: ${{ github.action_path }}/Gemfile
65-
RAILS_ROOT: ${{ inputs.rails-root }}
66-
GITHUB_TOKEN: ${{ inputs.github-token }}
67-
GITHUB_REPOSITORY: ${{ github.repository }}
68-
INPUT_CONFIG_FILE: ${{ inputs.config-file }}
69-
IMPORTMAP_BASE_BRANCH: ${{ inputs.base-branch }}
70-
IMPORTMAP_DRY_RUN: ${{ inputs.dry-run }}
71-
IMPORTMAP_AUTHOR_NAME: ${{ inputs.author-name }}
72-
IMPORTMAP_AUTHOR_EMAIL: ${{ inputs.author-email }}
73-
IMPORTMAP_OUTDATED_FILE: ${{ runner.temp }}/importmap-outdated.txt
74-
IMPORTMAP_AUDIT_FILE: ${{ runner.temp }}/importmap-audit.txt
64+
BUNDLE_GEMFILE: ${{ github.action_path }}/Gemfile
65+
RAILS_ROOT: ${{ inputs.rails-root }}
66+
GITHUB_TOKEN: ${{ inputs.github-token }}
67+
GITHUB_REPOSITORY: ${{ github.repository }}
68+
INPUT_CONFIG_FILE: ${{ inputs.config-file }}
69+
IMPORTMAP_BASE_BRANCH: ${{ inputs.base-branch }}
70+
IMPORTMAP_DRY_RUN: ${{ inputs.dry-run }}
71+
IMPORTMAP_AUTHOR_NAME: ${{ inputs.author-name }}
72+
IMPORTMAP_AUTHOR_EMAIL: ${{ inputs.author-email }}
73+
IMPORTMAP_OUTDATED_FILE: ${{ runner.temp }}/importmap-outdated.txt
74+
IMPORTMAP_AUDIT_FILE: ${{ runner.temp }}/importmap-audit.txt
75+
IMPORTMAP_OUTDATED_OUTPUT: ${{ steps.run-importmaps.outputs.importmap-outdated }}
76+
IMPORTMAP_AUDIT_OUTPUT: ${{ steps.run-importmaps.outputs.importmap-audit }}
7577
run: |
7678
bundle install
7779
bundle exec exe/importmap-update 2>&1 | tee "${IMPORTMAP_RUN_LOG:-/dev/null}"

exe/importmap-update

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ rescue Importmap::Update::Config::ConfigError => e
5151
exit 2
5252
end
5353

54-
outdated_file = ENV.fetch("IMPORTMAP_OUTDATED_FILE")
55-
audit_file = ENV.fetch("IMPORTMAP_AUDIT_FILE")
54+
# outdated_file = ENV.fetch("IMPORTMAP_OUTDATED_FILE")
55+
# audit_file = ENV.fetch("IMPORTMAP_AUDIT_FILE")
5656

5757
repo = ENV["GITHUB_REPOSITORY"]
5858
if repo.nil? || repo.empty?
@@ -75,8 +75,8 @@ git = Importmap::Update::GitClient.new(
7575
author_email: ENV.fetch("IMPORTMAP_AUTHOR_EMAIL", "github-actions[bot]@users.noreply.github.com")
7676
)
7777

78-
outdated_output = File.read(outdated_file)
79-
audit_output = File.read(audit_file)
78+
outdated_output = ENV.fetch("IMPORTMAP_OUTDATED_OUTPUT")
79+
audit_output = ENV.fetch("IMPORTMAP_AUDIT_OUTPUT")
8080
outdated = Importmap::Update::Parsers::OutdatedParser.parse(outdated_output)
8181
vulnerabilities = Importmap::Update::Parsers::AuditParser.parse(audit_output)
8282
plan = Importmap::Update::Planner.new(

0 commit comments

Comments
 (0)