Skip to content

Commit

Permalink
PR Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle committed Oct 6, 2023
1 parent a8ed65b commit 3cec5b1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/composite_actions/log_cw_metric/action.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Log CW Metric
description: Test to log a CW metric
description: Logs a metric to Cloudwatch.
inputs:
# For getting failing step
job-status:
Expand Down
4 changes: 1 addition & 3 deletions .github/composite_actions/log_cw_metric/dist/main.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .github/composite_actions/log_cw_metric/dist/main.cjs.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions .github/composite_actions/log_cw_metric_wrapper/action.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Log CW Metric Wrapper
description: Test to log a CW metric
description: Wrap additional inputs around the log_cw_metric action.

# Wraps log metric by configuring AWS credentials and adding github repo + run id inputs.
inputs:
Expand Down Expand Up @@ -58,17 +58,17 @@ runs:
run: |
if [ "${{ github.event_name }}" != "schedule" ]; then
echo "This was not triggered by a schedule, skipping."
echo "SKIP=true" >> $GITHUB_ENV
echo "SKIP_CW=true" >> $GITHUB_ENV
fi
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # 3.6.0
if: env.SKIP != 'true'
if: env.SKIP_CW != 'true'
with:
persist-credentials: false
submodules: true

- name: Configure AWS credentials
if: env.SKIP != 'true'
if: env.SKIP_CW != 'true'
uses: aws-actions/configure-aws-credentials@04b98b3f9e85f563fb061be8751a0352327246b0 # 3.0.1
with:
unset-current-credentials: true
Expand All @@ -77,7 +77,7 @@ runs:
role-duration-seconds: 900

- name: Log the CW Metrics
if: env.SKIP != 'true'
if: env.SKIP_CW != 'true'
uses: ./.github/composite_actions/log_cw_metric
with:
job-status: ${{ inputs.job-status }}
Expand Down
5 changes: 1 addition & 4 deletions actions/bin/log_cw_metric.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ Future<void> logMetric() async {
? await getFailingStep(jobIdentifier, githubToken, repo, runId)
: '';

core.info('Failing step was: $failingStep');

// Inputs for Metric
final metricName = core.getRequiredInput('metric-name');
final testType = core.getRequiredInput('test-type');
Expand Down Expand Up @@ -137,12 +135,11 @@ Future<String> getFailingStep(
final matchingJob =
jobsList.jobs.firstWhere((job) => job.name == jobIdentifier);
final steps = matchingJob.steps;
core.info('steps $steps');

final failingStep = steps.firstWhere(
(element) => element.conclusion == 'failure',
);
core.info('failingStep was: ${failingStep.name}');
core.info('FailingStep was: ${failingStep.name}');

return failingStep.name;
} on Exception catch (e) {
Expand Down

0 comments on commit 3cec5b1

Please sign in to comment.