You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for your interest in contributing to Fly Action! This guide will help you get started with development, testing, and publishing.
4
+
5
+
## Development Setup
6
+
7
+
To develop and test locally:
8
+
9
+
1. Clone the repository.
10
+
2. Install dependencies: `npm install` (this also runs Prettier via the `postinstall` hook).
11
+
3. Build: `npm run build` (this formats, type-checks TypeScript with `tsc`, and bundles the TypeScript source files into JavaScript for the action using `ncc`).
12
+
4. Run tests: `npm test`.
13
+
14
+
> A Husky pre-commit hook is configured—any `git commit` will trigger `npm run build` to ensure your code is formatted, compiled, and bundled before committing.
15
+
16
+
## Build Process
17
+
18
+
The action is built using `npm run build`. This command formats the code with Prettier, performs type checking using TypeScript (`tsc`), and then compiles and bundles `src/index.ts` and `src/post.ts` into single executable JavaScript files: `lib/index.js` and `lib/post.js`. These `lib/` files are what the GitHub Action executes.
19
+
20
+
A Husky pre-commit hook is configured to run `npm run build` automatically on each commit, ensuring that code is formatted, type-checked, and bundled before being committed.
21
+
22
+
## Testing
23
+
24
+
### Unit Tests
25
+
26
+
Run the unit tests with:
27
+
28
+
```bash
29
+
npm test
30
+
```
31
+
32
+
### Integration Tests
33
+
34
+
Integration tests run automatically on pushes to the main branch, but require a valid Fly test server to be configured. The integration test will only run if the `FLY_TEST_URL` repository variable is set.
35
+
36
+
To configure integration testing:
37
+
38
+
1. Set up a Fly server that supports the required API endpoints
39
+
2. Set the `FLY_TEST_URL` repository variable in your GitHub repository settings
40
+
3. The integration test will automatically run on the next push
41
+
42
+
## Publishing a New Version
43
+
44
+
- Ensure tests pass and build is up to date:
45
+
46
+
```bash
47
+
npm test&& npm run build
48
+
```
49
+
50
+
- Push changes to the default branch (e.g., `main`):
51
+
52
+
```bash
53
+
git push origin main
54
+
```
55
+
56
+
- Draft a release in the GitHub UI:
57
+
1. Go to the "Releases" page of your repository.
58
+
2. Click **Draft a new release**.
59
+
3. Set the tag name to `vX.Y.Z` (e.g., `v1.2.3`).
60
+
4. Publish the release.
61
+
62
+
Once the release is published, the GitHub Actions workflow will:
63
+
64
+
1. Extract the version from the tag (`vX.Y.Z`).
65
+
2. Bump `package.json` and `package-lock.json` to `X.Y.Z`.
66
+
3. Commit and push the updated lockfile.
67
+
4. Update and force-push the `vX.Y` and `vX` tags.
Copy file name to clipboardExpand all lines: README.md
+10-74Lines changed: 10 additions & 74 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,14 @@
3
3
# Fly Action
4
4
5
5
[](https://docs.jfrog-applications.jfrog.io/jfrog-applications/frogbot)
This GitHub Action downloads the Fly CLI and configures package managers to use Fly as a registry for dependencies.
10
11
12
+
For more information about JFrog Fly, see the [official documentation](https://docs.fly.jfrog.ai).
13
+
11
14
## Features
12
15
13
16
- ✅ Supports all package managers available in Fly CLI
@@ -42,7 +45,7 @@ jobs:
42
45
43
46
### OIDC Authentication (Required)
44
47
45
-
This action only supports OIDC authentication for enhanced security. You must set `permissions: id-token: write` in your workflow file.
48
+
This action requires OIDC authentication. The OIDC token is used to track uploads and downloads on the Fly server. You must set `permissions: id-token: write` in your workflow file.
46
49
47
50
```yaml
48
51
permissions:
@@ -69,27 +72,15 @@ permissions:
69
72
70
73
When using OIDC authentication:
71
74
72
-
1. Your Fly server must support the OpenID Connect protocol and have a provider configured
73
-
2. You need to set `permissions: id-token: write` in your workflow file
74
-
3. The provider name is fixed to `fly-action`
75
-
4. The action will:
75
+
1. You need to set `permissions: id-token: write` in your workflow file
76
+
2. The action will:
76
77
- Request an OIDC token from GitHub Actions
77
-
- Exchange it for a Fly access token via the `/fly/api/v1/ci/start-oidc` endpoint
78
+
- Exchange it for a Fly access token
78
79
- Use the resulting token to authenticate with Fly
79
-
- Automatically notify CI session end via the `/fly/api/v1/ci/end` endpoint when the job completes (using GitHub Actions post-job mechanism)
80
+
- Automatically notify the Fly server when the CI session ends (using GitHub Actions post-job mechanism)
80
81
81
82
> **Note**: The CI end notification runs automatically as a post-job step. This ensures it executes even if the main action fails, for proper session management on the Fly server. If the CI end notification step itself encounters an error, it will cause the overall workflow to be marked as failed.
82
83
83
-
### Fly Server Configuration for OIDC
84
-
85
-
To use OIDC authentication, your Fly server must be configured with:
86
-
87
-
1. An OIDC provider that accepts GitHub Actions tokens
88
-
2. Custom Fly API endpoints:
89
-
- `/fly/api/v1/ci/start-oidc`for token exchange and CI session initialization
90
-
- `/fly/api/v1/ci/end`for CI session end notification
91
-
3. Custom audience claim support (if using non-default audience)
92
-
93
84
## Supported Package Managers
94
85
95
86
The action supports all package managers that the Fly CLI supports:
@@ -103,64 +94,9 @@ The action supports all package managers that the Fly CLI supports:
103
94
- **gradle** – Gradle build tool
104
95
- **maven** – Maven build tool
105
96
106
-
## Testing
107
-
108
-
### Integration Tests
109
-
110
-
Integration tests run automatically on pushes to the main branch, but require a valid Fly test server to be configured. The integration test will only run if the `FLY_TEST_URL` repository variable is set.
111
-
112
-
To configure integration testing:
113
-
114
-
1. Set up a Fly server that supports the required API endpoints
115
-
2. Set the `FLY_TEST_URL` repository variable in your GitHub repository settings
116
-
3. The integration test will automatically run on the next push
117
-
118
-
## Build Process
119
-
120
-
The action is built using `npm run build`. This command formats the code with Prettier, performs type checking using TypeScript (`tsc`), and then compiles and bundles `src/index.ts` and `src/post.ts` into single executable JavaScript files: `lib/index.js`and `lib/post.js`. These `lib/` files are what the GitHub Action executes.
121
-
122
-
A Husky pre-commit hook is configured to run `npm run build` automatically on each commit, ensuring that code is formatted, type-checked, and bundled before being committed.
123
-
124
-
## Building and Publishing
125
-
126
-
### Development Setup
127
-
128
-
To develop and test locally:
129
-
130
-
1. Clone the repository.
131
-
2. Install dependencies: `npm install`(this also runs Prettier via the `postinstall` hook).
132
-
3. Build: `npm run build`(this formats, type-checks TypeScript with `tsc`, and bundles the TypeScript source files into JavaScript for the action using `ncc`).
133
-
4. Run tests: `npm test`.
134
-
135
-
> A Husky pre-commit hook is configured—any `git commit` will trigger `npm run build` to ensure your code is formatted, compiled, and bundled before committing.
136
-
137
-
### Publishing a new version
138
-
139
-
- Ensure tests pass and build is up to date:
140
-
141
-
```bash
142
-
npm test && npm run build
143
-
```
144
-
145
-
- Push changes to the default branch (e.g., `main`):
146
-
147
-
```bash
148
-
git push origin main
149
-
```
150
-
151
-
- Draft a release in the GitHub UI:
152
-
1. Go to the “Releases” page of your repository.
153
-
2. Click **Draft a new release**.
154
-
3. Set the tag name to `vX.Y.Z` (e.g., `v1.2.3`).
155
-
4. Publish the release.
156
-
157
-
Once the release is published, the GitHub Actions workflow will:
97
+
## Contributing
158
98
159
-
1. Extract the version from the tag (`vX.Y.Z`).
160
-
2. Bump `package.json` and `package-lock.json` to `X.Y.Z`.
161
-
3. Commit and push the updated lockfile.
162
-
4. Update and force-push the `vX.Y` and `vX` tags.
163
-
5. Push all changes back to the repository.
99
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for information on development setup, testing, and publishing.
0 commit comments