Skip to content

Commit 4b2ffe3

Browse files
committed
Refactor logging in action.ts and update workflows
- Improved error logging in action.ts for better visibility of environment variable states. - Minor formatting adjustments in security.yml and test-action.yml to ensure consistency in file endings.
1 parent 2018eba commit 4b2ffe3

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/security.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,4 @@ jobs:
8383
echo "2. Enable 'Code scanning' under Code security and analysis"
8484
echo "3. Or upgrade to GitHub Advanced Security if using GitHub Enterprise"
8585
echo ""
86-
echo "For now, the workflow will continue with other security checks."
86+
echo "For now, the workflow will continue with other security checks."

.github/workflows/test-action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ jobs:
4646
env:
4747
# Ensure the token is available as both INPUT_GITHUB_TOKEN and GITHUB_TOKEN
4848
INPUT_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

src/action.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,17 @@ async function main() {
1212
const comment = process.env.INPUT_COMMENT !== 'false';
1313
const statusCheck = process.env.INPUT_STATUS_CHECK !== 'false';
1414

15-
1615
if (!githubToken) {
1716
console.error('❌ GitHub token is required');
1817
console.error('Available environment variables:');
19-
console.error('INPUT_GITHUB_TOKEN:', process.env.INPUT_GITHUB_TOKEN ? '***' : 'undefined');
20-
console.error('GITHUB_TOKEN:', process.env.GITHUB_TOKEN ? '***' : 'undefined');
18+
console.error(
19+
'INPUT_GITHUB_TOKEN:',
20+
process.env.INPUT_GITHUB_TOKEN ? '***' : 'undefined'
21+
);
22+
console.error(
23+
'GITHUB_TOKEN:',
24+
process.env.GITHUB_TOKEN ? '***' : 'undefined'
25+
);
2126
process.exit(1);
2227
}
2328

0 commit comments

Comments
 (0)