Skip to content
New issue

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

Check that the ETag value is nonempty #38

Merged

Conversation

toobuntu
Copy link
Contributor

No description provided.

@PikachuEXE PikachuEXE merged commit a5545c1 into PikachuEXE:master Aug 23, 2024
4 checks passed
@toobuntu toobuntu deleted the actions/update-actionlint-etag-nonempty branch August 23, 2024 01:17
@PikachuEXE
Copy link
Owner

Possible to make it send me workflow failure notification daily? lol

@toobuntu
Copy link
Contributor Author

It seems so: https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/monitoring-workflows/notifications-for-workflow-runs

The thing is, okay now it doesn't create a PR, but it was working before and now it is not. This is unsatisfying because we do not know why or what changed. On my local system it fails when the .github/etags directory does not exist and succeeds when it does, even when that directory is empty and even, like here, when not using a GitHub PAT. But this repo does have that directory, and it is even populated with etag files.

If you want, and if you have GitHub Actions enabled for branches, you could create a debug branch and modify the workflow file to add some echos for debugging output and change --silent to --verbose in the curl command. Hopefully, that would supply some more information.

The truth is, these particular files are only to configure the Actionlint linter and are not expected to change often. But it remains unsatisfying that the workflow no longer works.

@toobuntu
Copy link
Contributor Author

On my local system, I discovered an interesting data point. The ETag file alternates between populated and empty. I do not yet understand why or how to deal with it. This was supposed to be fixed in curl 7.70.0. The macos-14 GitHub runner is using Curl 8.7.1 (updated three weeks ago from 8.6.0). Any thoughts?

# curl --version
curl 8.7.1 (x86_64-apple-darwin23.0) libcurl/8.7.1 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.61.0
Release-Date: 2024-03-27
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM SPNEGO SSL threadsafe UnixSockets

# mkdir -p ".github/etags"; curl --fail --silent --show-error --location --retry 3 --retry-all-errors --remove-on-error --etag-compare ".github/etags/etag.txt" --etag-save ".github/etags/etag.txt" --remote-name --clobber --output-dir ".github/workflows" --create-dirs --url "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/.github/workflows/actionlint.yml"; ls .github/etags/etag.txt .github/workflows/actionlint.yml;
.rw-r--r-- 1.7k toobuntu staff 25 Aug 15:31 .github/workflows/actionlint.yml
.rw-r--r--   67 toobuntu staff 25 Aug 15:31 .github/etags/etag.txt
# mkdir -p ".github/etags"; curl --fail --silent --show-error --location --retry 3 --retry-all-errors --remove-on-error --etag-compare ".github/etags/etag.txt" --etag-save ".github/etags/etag.txt" --remote-name --clobber --output-dir ".github/workflows" --create-dirs --url "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/.github/workflows/actionlint.yml"; ls .github/etags/etag.txt .github/workflows/actionlint.yml;
.rw-r--r-- 1.7k toobuntu staff 25 Aug 15:31 .github/workflows/actionlint.yml
.rw-r--r--    0 toobuntu staff 25 Aug 15:31 .github/etags/etag.txt
# mkdir -p ".github/etags"; curl --fail --silent --show-error --location --retry 3 --retry-all-errors --remove-on-error --etag-compare ".github/etags/etag.txt" --etag-save ".github/etags/etag.txt" --remote-name --clobber --output-dir ".github/workflows" --create-dirs --url "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/.github/workflows/actionlint.yml"; ls .github/etags/etag.txt .github/workflows/actionlint.yml;
.rw-r--r-- 1.7k toobuntu staff 25 Aug 15:31 .github/workflows/actionlint.yml
.rw-r--r--   67 toobuntu staff 25 Aug 15:31 .github/etags/etag.txt
# mkdir -p ".github/etags"; curl --fail --silent --show-error --location --retry 3 --retry-all-errors --remove-on-error --etag-compare ".github/etags/etag.txt" --etag-save ".github/etags/etag.txt" --remote-name --clobber --output-dir ".github/workflows" --create-dirs --url "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/.github/workflows/actionlint.yml"; ls .github/etags/etag.txt .github/workflows/actionlint.yml;
.rw-r--r-- 1.7k toobuntu staff 25 Aug 15:31 .github/workflows/actionlint.yml
.rw-r--r--    0 toobuntu staff 25 Aug 15:31 .github/etags/etag.txt
# mkdir -p ".github/etags"; curl --fail --silent --show-error --location --retry 3 --retry-all-errors --remove-on-error --etag-compare ".github/etags/etag.txt" --etag-save ".github/etags/etag.txt" --remote-name --clobber --output-dir ".github/workflows" --create-dirs --url "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/.github/workflows/actionlint.yml"; ls .github/etags/etag.txt .github/workflows/actionlint.yml;

There is a workaround mentioned in a comment. But it did not work in my testing:

# mkdir -p ".github/etags"; curl --fail --silent --show-error --location --retry 3 --retry-all-errors --remove-on-error --etag-compare ".github/etags/etag.txt" --etag-save ".github/etags/etag.tmp" --remote-name --clobber --output-dir ".github/workflows" --create-dirs --url "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/.github/workflows/actionlint.yml"; /bin/mv ".github/etags/etag.tmp" ".github/etags/etag.txt"; ls .github/etags/etag.txt .github/workflows/actionlint.yml;
.rw-r--r-- 1.7k toobuntu staff 25 Aug 15:48 .github/workflows/actionlint.yml
.rw-r--r--   67 toobuntu staff 25 Aug 15:48 .github/etags/etag.txt
# mkdir -p ".github/etags"; curl --fail --silent --show-error --location --retry 3 --retry-all-errors --remove-on-error --etag-compare ".github/etags/etag.txt" --etag-save ".github/etags/etag.tmp" --remote-name --clobber --output-dir ".github/workflows" --create-dirs --url "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/.github/workflows/actionlint.yml"; /bin/mv ".github/etags/etag.tmp" ".github/etags/etag.txt"; ls .github/etags/etag.txt .github/workflows/actionlint.yml;
.rw-r--r-- 1.7k toobuntu staff 25 Aug 15:48 .github/workflows/actionlint.yml
.rw-r--r--    0 toobuntu staff 25 Aug 15:48 .github/etags/etag.txt
# mkdir -p ".github/etags"; curl --fail --silent --show-error --location --retry 3 --retry-all-errors --remove-on-error --etag-compare ".github/etags/etag.txt" --etag-save ".github/etags/etag.tmp" --remote-name --clobber --output-dir ".github/workflows" --create-dirs --url "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/.github/workflows/actionlint.yml"; /bin/mv ".github/etags/etag.tmp" ".github/etags/etag.txt"; ls .github/etags/etag.txt .github/workflows/actionlint.yml;
.rw-r--r-- 1.7k toobuntu staff 25 Aug 15:48 .github/workflows/actionlint.yml
.rw-r--r--   67 toobuntu staff 25 Aug 15:48 .github/etags/etag.txt

So unless you have any ideas how to deal with this, it might be best to remove the --etag-compare and --etag-save parts of the curl command until it is fixed upstream.

@toobuntu
Copy link
Contributor Author

Alternatively, running curl twice: the first time with --etag-save and the second time with --etag-compare does work. It exhibits the alternating empty file behavior only when those two options are provided in the same command line (which is supposed to work but doesn't seem to).

I still do not understand why it worked before and stopped working two weeks ago...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants