Skip to content

Instantly share code, notes, and snippets.

View samitha9125's full-sized avatar
🎯
Focusing

Samitha Nanayakkara samitha9125

🎯
Focusing
View GitHub Profile
@samitha9125
samitha9125 / fileSize.danger.ts
Created October 7, 2023 07:34
Danger JS - File Size Check
/**
* This script serves as a mechanism to ensure that no files exceeding a size of 50MB are committed to the repository.
* It checks the size of each file that has been modified or created in the current git commit, and alerts the developer if any oversized files are found.
*
* Requirement:
* 1. **File Size Check**: Before committing files, it's crucial to ensure that file sizes are within reasonable limits to prevent bloating the repository.
*
* Note:
* - This script can be executed either locally or as part of a CI/CD pipeline.
* - When executed locally, it can be run with the `danger local` option or integrated with git hooks using tools such as Husky to perform checks when a developer executes a git commit.
@samitha9125
samitha9125 / slack-reminder.js
Last active October 7, 2023 07:23
GitHub Action JS Script for Slack Reminders
import { IncomingWebhook } from '@slack/webhook';
import github from '@actions/github';
import messages from './messages.js';
import { NIGHTLY_SLACK } from './slackConfig.js';
import Version from '../version/index.js';
/**
* This function serves as a reminder mechanism for nightly builds.
* It checks the state of the GitHub workflow and sends a reminder message to a Slack channel
@samitha9125
samitha9125 / reuse-shared-workflow.yml
Last active October 7, 2023 07:01
Passing Runners to Shared/Reusable Workflow (Ideal for Self Hosted)
# GitHub Actions Workflow: Reusing the Shared Workflow
#
# Summary:
# This workflow shows the reuse of a shared workflow to perform preliminary setup tasks.
# It is triggered manually via the GitHub UI or through the GitHub REST API, and executes the shared
# workflow defined in '.github/workflows/shared-workflow.yml'. This shared workflow is expected to handle
# the installation of Yarn and CocoaPod dependencies.
#
# Triggers:
# - Manually triggered by users via the GitHub UI or through the GitHub REST API using the `workflow_dispatch` event.