Skip to content

Conversation

@gjarzebak95
Copy link
Contributor

Summary

  • Add permissions block with packages: write to allow pushing to GitHub Packages registry
  • Change Dockerfile CMD from shell form to JSON array format for proper OS signal handling

Problem

The CI workflow was failing with:

ERROR: denied: installation not allowed to Write organization package

This was due to missing packages: write permission on the workflow.

Additionally, Docker was warning about the CMD format:

JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals

Changes

  1. ci.yml: Added permissions block:

    permissions:
      contents: read
      packages: write
  2. Dockerfile: Changed CMD from shell form to JSON array:

    # Before
    CMD cd /app && npm start
    
    # After
    CMD ["npm", "start"]

Test Plan

  • CI workflow completes successfully
  • Docker image is pushed to GitHub Packages
  • No warnings in build output

- Add query parameter to filter suspended users at API level
- Add secondary filter in formatUserList for archived users
- Include suspended/archived fields in API response
- Add tests for suspended/archived user filtering
Previously, any mismatch would trigger non-zero exit even when
ADD_USERS and REMOVE_USERS were enabled and changes were made.
Now only exits non-zero when mismatch exists AND changes were
not configured to be applied (dry-run mode).
- Add OperationError interface to track individual failures
- Add OperationResult interface to collect successes and errors
- Wrap GitHub API calls in try/catch blocks
- Parse specific error codes (422, 403, 404) with helpful messages
- Surface max user count errors (422) clearly
- Collect all errors and display summary at end of run
- Exit with non-zero when errors occur
- Add slack.ts module with notification functionality
- Add config options: SLACK_WEBHOOK_URL, SLACK_NOTIFY_ON_ERROR,
  SLACK_NOTIFY_ON_CHANGE, SLACK_NOTIFY_ALWAYS
- Update action.yml with new Slack inputs
- Send notifications on errors (default), changes (opt-in), or always
- Format messages with users added, removed, and any errors
Node 15.12.0 was EOL. Updated to Node 18 LTS for security and
compatibility. Major npm package updates (octokit, jest, eslint)
require careful testing due to breaking API changes and should
be addressed in a follow-up PR.
- Remove unused slack import from index.spec.ts
- Remove unused consoleSpy variable from slack.spec.ts
- Add eslint-disable comments for necessary any types in test mocks
- actions/checkout: v3.5.2 → v4.2.2
- actions/setup-node: v3.6.0 → v4.1.0
- actions/cache: v3.3.1 → v4.2.3

Fixes CI failure due to deprecated actions/cache version being blocked
by GitHub as of Dec 2024.
- Add permissions block with packages:write to allow pushing to
  GitHub Packages registry
- Change Dockerfile CMD from shell form to JSON array format
  to properly handle OS signals
@gjarzebak95
Copy link
Contributor Author

Closing - created on wrong branch. Will recreate from main.

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