-
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.
Merge pull request #4 from Q42/fix-verify
chore: Update docs & test
- Loading branch information
Showing
3 changed files
with
16 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,12 +12,13 @@ on: | |
|
||
jobs: | ||
enforce-label: | ||
if: github.event_name == 'pull_request' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: yogevbd/[email protected] | ||
with: | ||
REQUIRED_LABELS_ANY: "feature,bug,maintenance,ignore-for-release,major,minor,patch,github-actions" | ||
REQUIRED_LABELS_ANY_DESCRIPTION: "Select at least one label ['feature','bug','maintenance','ignore-for-release', 'major', 'minor', 'patch', 'github-actions']" | ||
REQUIRED_LABELS_ANY: "feature,bug,maintenance,chore,ignore-for-release,major,minor,patch,github-actions" | ||
REQUIRED_LABELS_ANY_DESCRIPTION: "Select at least one label ['feature','bug','maintenance', 'chore', 'ignore-for-release', 'major', 'minor', 'patch', 'github-actions']" | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
|
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 |
---|---|---|
@@ -1,12 +1,22 @@ | ||
# Compute API | ||
|
||
This is a utility library for communicating with Google Cloud metadata service on Google Cloud. Based on the [Go implementation](https://pkg.go.dev/cloud.google.com/go/compute/metadata#section-readme) | ||
This is a utility library for communicating with [Google Cloud metadata service](https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys) on Google Cloud. Based on the [Go implementation](https://pkg.go.dev/cloud.google.com/go/compute/metadata#section-readme) | ||
|
||
## using the package | ||
|
||
You can use the package in the following way: | ||
|
||
```aspx-csharp | ||
```csharp | ||
using var metadata = new MetadataClient(); | ||
var onGce = await metadata.IsOnGCEAsync(context.CancellationToken); | ||
``` | ||
|
||
Alternatively you can also inject the client using DI, the client will cache any responses gotten from the metadata api. | ||
|
||
### Errors when not running on GCE | ||
|
||
By default the package does not throw any errors if you are not running on GCE and functions called will return null, however you can enable throwing errors by setting `throwIfNotOnGCE` to true when creating the client. | ||
|
||
```csharp | ||
using var metadata = new MetadataClient(throwIfNotOnGce: true); | ||
``` |