Skip to content

Commit 03c7dfc

Browse files
committed
Configure "Check Go Dependencies" workflow to avoid failure of licensed installation
The "licensed" tool is used to check the project's compatibility with licensing of its dependencies. This tool is installed by the "Check Go Dependencies" GitHub Actions workflow using the `jonabc/setup-licensed` GitHub Actions action. This action attempts the installation according to the following procedure: 1. Install the Ruby gem. 2. If gem installation fails, install the release asset from the `github/licensed` repo. Spurious failures of the "Check Go Dependencies" workflow runs are occurring due to hitting the rate limit during the attempt to install the release asset via the GitHub API in step (2). The error message shown in the workflow run logs when this failure occurs: > Error: API rate limit exceeded for 104.45.203.178. (But here's the good news: Authenticated requests get a higher rate > limit. Check out the documentation for more details.) suggests the rate limiting could be avoided by providing an authentication token for the GitHub API request. However, the workflow already does this, and it is used by the action, but intentionally not for this specific API request. The problem would be avoided entirely if the gem installation at step (1) was successful. It was failing with the following error shown in the workflow run logs: > ERROR: While executing gem ... (Gem::FilePermissionError) > You don't have write permissions for the /var/lib/gems/3.0.0 directory. > gem installation was not successful This failure can be avoided by setting up an accessible installation of Ruby in the runner machine, which is accomplished using the `ruby/setup-ruby` action in a step preceding the `jonabc/setup-licensed` step in the workflow.
1 parent 9269407 commit 03c7dfc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/check-go-dependencies-task.yml

+12
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ jobs:
6969
with:
7070
submodules: recursive
7171

72+
# This is required to allow jonabc/setup-licensed to install licensed via Ruby gem.
73+
- name: Install Ruby
74+
uses: ruby/setup-ruby@v1
75+
with:
76+
ruby-version: ruby # Install latest version
77+
7278
- name: Install licensed
7379
uses: jonabc/setup-licensed@v1
7480
with:
@@ -119,6 +125,12 @@ jobs:
119125
with:
120126
submodules: recursive
121127

128+
# This is required to allow jonabc/setup-licensed to install licensed via Ruby gem.
129+
- name: Install Ruby
130+
uses: ruby/setup-ruby@v1
131+
with:
132+
ruby-version: ruby # Install latest version
133+
122134
- name: Install licensed
123135
uses: jonabc/setup-licensed@v1
124136
with:

0 commit comments

Comments
 (0)