-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
68 lines (65 loc) · 2.47 KB
/
action.yml
File metadata and controls
68 lines (65 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: "Importmap Update"
description: "Dependabot-style automated dependency updates for Rails importmap-rails apps."
author: "thoughtbot"
branding:
icon: "package"
color: "red"
inputs:
config-file:
description: "Path to the YAML config inside the consuming repo."
required: false
default: ".github/importmap-updates.yml"
github-token:
description: "Token used by Octokit to list, open, edit, and close PRs."
required: true
base-branch:
description: "Branch to base PRs against."
required: false
default: "main"
dry-run:
description: "When 'true', run end-to-end but skip all side effects (no commits, pushes, or PR operations)."
required: false
default: "false"
ruby-version:
description: "Ruby version to set up. Defaults to the consuming repo's .ruby-version."
required: false
author-name:
description: "Git author name for commits."
required: false
default: "github-actions[bot]"
author-email:
description: "Git author email for commits."
required: false
default: "github-actions[bot]@users.noreply.github.com"
rails-root:
description: "Directory containing the Rails app to run against. Useful when the app lives in a subdirectory or for integration testing."
required: false
default: "${{ github.workspace }}"
runs:
using: "composite"
steps:
- name: Save importmap outputs
shell: bash
working-directory: ${{ inputs.rails-root }}
run: |
bin/importmap audit 2>&1 | tee /tmp/importmap-audit.txt || true
bin/importmap outdated 2>&1 | tee /tmp/importmap-outdated.txt || true
- name: Run importmap-update
shell: bash
working-directory: ${{ github.action_path }}
env:
BUNDLE_GEMFILE: ${{ github.action_path }}/Gemfile
RAILS_ROOT: ${{ inputs.rails-root }}
GITHUB_TOKEN: ${{ inputs.github-token }}
GITHUB_REPOSITORY: ${{ github.repository }}
INPUT_CONFIG_FILE: ${{ inputs.config-file }}
IMPORTMAP_BASE_BRANCH: ${{ inputs.base-branch }}
IMPORTMAP_DRY_RUN: ${{ inputs.dry-run }}
IMPORTMAP_AUTHOR_NAME: ${{ inputs.author-name }}
IMPORTMAP_AUTHOR_EMAIL: ${{ inputs.author-email }}
run: |
bundle install
bundle exec exe/importmap-update \
--outdated-file /tmp/importmap-outdated.txt \
--audit-file /tmp/importmap-audit.txt \
2>&1 | tee "${IMPORTMAP_RUN_LOG:-/dev/null}"