forked from 2factorauth/twofactorauth
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add quality checks for entries (2factorauth#6132)
* Add quality checks for entries files * Fix rubocop errors fix rubocop errors v2 fix typo * Change file permissions * Apply Suggestions
- Loading branch information
1 parent
f47e0ae
commit a8fadcc
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
require 'json' | ||
|
||
# Fetch created (but not renamed) files in entries/** | ||
diff = `git diff --name-only --diff-filter=Ar origin/master...HEAD entries/`.split("\n") | ||
|
||
diff&.each do |path| | ||
entry = JSON.parse(File.read(path)).values[0] | ||
next unless entry.key? 'tfa' | ||
|
||
# rubocop:disable Layout/LineLength | ||
puts "::notice file=#{path} title=Missing Documentation:: Since there is no documentation available, please could you provide us with screenshots of the setup/login process as evidence of 2FA? Please remember to block out any personal information." unless entry['documentation'] | ||
puts "::warning file=#{path}:: A `custom-software` tag is needed since it has been included in the `tfa` array." if entry['tfa'].include?('custom-software') && !entry['custom-software'] | ||
puts "::warning file=#{path}:: A `custom-hardware` tag is needed since it has been included in the `tfa` array." if entry['tfa'].include?('custom-hardware') && !entry['custom-hardware'] | ||
# rubocop:enable Layout/LineLength | ||
end |